Browse Source

enforce that exactly one auth property is used

rodrmartinez 4 years ago
parent
commit
39038b03c8

+ 2 - 0
apis/externalsecrets/v1alpha1/secretstore_kubernetes_types.go

@@ -55,6 +55,8 @@ type KubernetesProvider struct {
 	RemoteNamespace string `json:"remoteNamespace"`
 }
 
+// +kubebuilder:validation:MinProperties=1
+// +kubebuilder:validation:MaxProperties=1
 type KubernetesAuth struct {
 	// has both clientCert and clientKey as secretKeySelector
 	// +optional

+ 2 - 0
deploy/crds/external-secrets.io_clustersecretstores.yaml

@@ -562,6 +562,8 @@ spec:
                       auth:
                         description: Auth configures how secret-manager authenticates
                           with a Kubernetes instance.
+                        maxProperties: 1
+                        minProperties: 1
                         properties:
                           cert:
                             description: has both clientCert and clientKey as secretKeySelector

+ 2 - 0
deploy/crds/external-secrets.io_secretstores.yaml

@@ -562,6 +562,8 @@ spec:
                       auth:
                         description: Auth configures how secret-manager authenticates
                           with a Kubernetes instance.
+                        maxProperties: 1
+                        minProperties: 1
                         properties:
                           cert:
                             description: has both clientCert and clientKey as secretKeySelector