Browse Source

add validations for the remaining enum values (#2860)

* add validations for the remaining enum values

Signed-off-by: lakhan jindam <lakhanj569@gmail.com>

* generate crd configs using make reviewable cmd and address review comments

Signed-off-by: lakhan jindam <lakhanj569@gmail.com>

---------

Signed-off-by: lakhan jindam <lakhanj569@gmail.com>
Lakhan Jindam 2 years ago
parent
commit
325f36e47d

+ 1 - 0
apis/externalsecrets/v1alpha1/secretstore_oracle_types.go

@@ -16,6 +16,7 @@ import (
 	esmeta "github.com/external-secrets/external-secrets/apis/meta/v1"
 )
 
+// +kubebuilder:validation:Enum="";UserPrincipal;InstancePrincipal;Workload
 type OraclePrincipalType string
 
 const (

+ 1 - 0
apis/externalsecrets/v1beta1/secretstore_oracle_types.go

@@ -16,6 +16,7 @@ import (
 	esmeta "github.com/external-secrets/external-secrets/apis/meta/v1"
 )
 
+// +kubebuilder:validation:Enum="";UserPrincipal;InstancePrincipal;Workload
 type OraclePrincipalType string
 
 const (

+ 1 - 0
apis/generators/v1alpha1/generator_vault.go

@@ -48,6 +48,7 @@ type VaultDynamicSecretSpec struct {
 	Path string `json:"path"`
 }
 
+// +kubebuilder:validation:Enum=Data;Auth
 type VaultDynamicSecretResultType string
 
 const (

+ 10 - 0
config/crds/bases/external-secrets.io_clustersecretstores.yaml

@@ -956,6 +956,11 @@ spec:
                           If left blank, the Auth struct will determine the principal
                           type. This optional field must be specified if using workload
                           identity.
+                        enum:
+                        - ""
+                        - UserPrincipal
+                        - InstancePrincipal
+                        - Workload
                         type: string
                       region:
                         description: Region is the region where vault is located.
@@ -3089,6 +3094,11 @@ spec:
                           If left blank, the Auth struct will determine the principal
                           type. This optional field must be specified if using workload
                           identity.
+                        enum:
+                        - ""
+                        - UserPrincipal
+                        - InstancePrincipal
+                        - Workload
                         type: string
                       region:
                         description: Region is the region where vault is located.

+ 10 - 0
config/crds/bases/external-secrets.io_secretstores.yaml

@@ -956,6 +956,11 @@ spec:
                           If left blank, the Auth struct will determine the principal
                           type. This optional field must be specified if using workload
                           identity.
+                        enum:
+                        - ""
+                        - UserPrincipal
+                        - InstancePrincipal
+                        - Workload
                         type: string
                       region:
                         description: Region is the region where vault is located.
@@ -3089,6 +3094,11 @@ spec:
                           If left blank, the Auth struct will determine the principal
                           type. This optional field must be specified if using workload
                           identity.
+                        enum:
+                        - ""
+                        - UserPrincipal
+                        - InstancePrincipal
+                        - Workload
                         type: string
                       region:
                         description: Region is the region where vault is located.

+ 3 - 0
config/crds/bases/generators.external-secrets.io_vaultdynamicsecrets.yaml

@@ -624,6 +624,9 @@ spec:
                   using e.g. /auth/token/create the "data" section is empty but the
                   "auth" section contains the generated token. Please refer to the
                   vault docs regarding the result data structure.
+                enum:
+                - Data
+                - Auth
                 type: string
             required:
             - path

+ 23 - 0
deploy/crds/bundle.yaml

@@ -1234,6 +1234,11 @@ spec:
                           type: string
                         principalType:
                           description: The type of principal to use for authentication. If left blank, the Auth struct will determine the principal type. This optional field must be specified if using workload identity.
+                          enum:
+                            - ""
+                            - UserPrincipal
+                            - InstancePrincipal
+                            - Workload
                           type: string
                         region:
                           description: Region is the region where vault is located.
@@ -2789,6 +2794,11 @@ spec:
                           type: string
                         principalType:
                           description: The type of principal to use for authentication. If left blank, the Auth struct will determine the principal type. This optional field must be specified if using workload identity.
+                          enum:
+                            - ""
+                            - UserPrincipal
+                            - InstancePrincipal
+                            - Workload
                           type: string
                         region:
                           description: Region is the region where vault is located.
@@ -5168,6 +5178,11 @@ spec:
                           type: string
                         principalType:
                           description: The type of principal to use for authentication. If left blank, the Auth struct will determine the principal type. This optional field must be specified if using workload identity.
+                          enum:
+                            - ""
+                            - UserPrincipal
+                            - InstancePrincipal
+                            - Workload
                           type: string
                         region:
                           description: Region is the region where vault is located.
@@ -6723,6 +6738,11 @@ spec:
                           type: string
                         principalType:
                           description: The type of principal to use for authentication. If left blank, the Auth struct will determine the principal type. This optional field must be specified if using workload identity.
+                          enum:
+                            - ""
+                            - UserPrincipal
+                            - InstancePrincipal
+                            - Workload
                           type: string
                         region:
                           description: Region is the region where vault is located.
@@ -8406,6 +8426,9 @@ spec:
                 resultType:
                   default: Data
                   description: Result type defines which data is returned from the generator. By default it is the "data" section of the Vault API response. When using e.g. /auth/token/create the "data" section is empty but the "auth" section contains the generated token. Please refer to the vault docs regarding the result data structure.
+                  enum:
+                    - Data
+                    - Auth
                   type: string
               required:
                 - path