Skip to content

Commit 8c082be

Browse files
committed
fix: use object type for encryption providers
1 parent b300372 commit 8c082be

6 files changed

+98
-33
lines changed

api/v1alpha1/clusterconfig_types.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ import (
1212
"github.com/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix/common/pkg/capi/clustertopology/variables"
1313
)
1414

15-
const (
16-
AESCBC EncryptionProvider = "aescbc"
17-
SecretBox EncryptionProvider = "secretbox"
18-
)
19-
2015
var (
2116
DefaultDockerCertSANs = []string{
2217
"localhost",
@@ -292,15 +287,22 @@ type User struct {
292287
// Currently the encryption only enabled for secrets and configmaps.
293288
type Encryption struct {
294289
// Encryption providers
295-
// +kubebuilder:validation:UniqueItems=true
296-
// +kubebuilder:validation:MaxItems=1
297-
// +kubebuilder:validation:Enum=aescbc
290+
// +kubebuilder:validation:Enum=aescbc;secretbox
298291
// +kubebuilder:default=aescbc
299-
// +optional
300-
Providers []EncryptionProvider `json:"providers"`
292+
// +kubebuilder:validation:Optional
293+
Providers *EncryptionProviders `json:"providers"`
301294
}
302295

303-
type EncryptionProvider string
296+
type EncryptionProviders struct {
297+
// +kubebuilder:validation:Optional
298+
AESCBC *AESConfiguration `json:"aescbc"`
299+
// +kubebuilder:validation:Optional
300+
Secretbox *SecretboxConfiguration `json:"secretbox"`
301+
}
302+
303+
type AESConfiguration struct{}
304+
305+
type SecretboxConfiguration struct{}
304306

305307
func init() {
306308
SchemeBuilder.Register(

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ spec:
333333
description: Encryption providers
334334
enum:
335335
- aescbc
336-
items:
337-
type: string
338-
maxItems: 1
339-
type: array
340-
uniqueItems: true
336+
- secretbox
337+
properties:
338+
aescbc:
339+
type: object
340+
secretbox:
341+
type: object
342+
type: object
341343
type: object
342344
etcd:
343345
properties:

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,13 @@ spec:
250250
description: Encryption providers
251251
enum:
252252
- aescbc
253-
items:
254-
type: string
255-
maxItems: 1
256-
type: array
257-
uniqueItems: true
253+
- secretbox
254+
properties:
255+
aescbc:
256+
type: object
257+
secretbox:
258+
type: object
259+
type: object
258260
type: object
259261
etcd:
260262
properties:

api/v1alpha1/crds/caren.nutanix.com_genericclusterconfigs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ spec:
244244
description: Encryption providers
245245
enum:
246246
- aescbc
247-
items:
248-
type: string
249-
maxItems: 1
250-
type: array
251-
uniqueItems: true
247+
- secretbox
248+
properties:
249+
aescbc:
250+
type: object
251+
secretbox:
252+
type: object
253+
type: object
252254
type: object
253255
etcd:
254256
properties:

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,13 @@ spec:
421421
description: Encryption providers
422422
enum:
423423
- aescbc
424-
items:
425-
type: string
426-
maxItems: 1
427-
type: array
428-
uniqueItems: true
424+
- secretbox
425+
properties:
426+
aescbc:
427+
type: object
428+
secretbox:
429+
type: object
430+
type: object
429431
type: object
430432
etcd:
431433
properties:

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 57 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)