Browse Source

fix(gcp): makes workload identity parameters optional (#4622)

* fix(gcp): makes workload identity parameters optional

Signed-off-by: Gustavo Carvalho <gustavo@externalsecrets.com>

* fix: helm test update

Signed-off-by: Gustavo Carvalho <gustavo@externalsecrets.com>

---------

Signed-off-by: Gustavo Carvalho <gustavo@externalsecrets.com>
Gustavo Fernandes de Carvalho 1 year ago
parent
commit
3cebf4157b

+ 13 - 3
apis/externalsecrets/v1beta1/secretstore_gcpsm_types.go

@@ -32,10 +32,20 @@ type GCPSMAuthSecretRef struct {
 }
 
 type GCPWorkloadIdentity struct {
+	// +kubebuilder:validation:Required
 	ServiceAccountRef esmeta.ServiceAccountSelector `json:"serviceAccountRef"`
-	ClusterLocation   string                        `json:"clusterLocation"`
-	ClusterName       string                        `json:"clusterName"`
-	ClusterProjectID  string                        `json:"clusterProjectID,omitempty"`
+	// ClusterLocation is the location of the cluster
+	// If not specified, it fetches information from the metadata server
+	// +optional
+	ClusterLocation string `json:"clusterLocation,omitempty"`
+	// ClusterName is the name of the cluster
+	// If not specified, it fetches information from the metadata server
+	// +optional
+	ClusterName string `json:"clusterName,omitempty"`
+	// ClusterProjectID is the project ID of the cluster
+	// If not specified, it fetches information from the metadata server
+	// +optional
+	ClusterProjectID string `json:"clusterProjectID,omitempty"`
 }
 
 // GCPSMProvider Configures a store to sync secrets using the GCP Secret Manager provider.

+ 9 - 2
config/crds/bases/external-secrets.io_clustersecretstores.yaml

@@ -3794,10 +3794,19 @@ spec:
                           workloadIdentity:
                             properties:
                               clusterLocation:
+                                description: |-
+                                  ClusterLocation is the location of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               clusterName:
+                                description: |-
+                                  ClusterName is the name of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               clusterProjectID:
+                                description: |-
+                                  ClusterProjectID is the project ID of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               serviceAccountRef:
                                 description: A reference to a ServiceAccount resource.
@@ -3829,8 +3838,6 @@ spec:
                                 - name
                                 type: object
                             required:
-                            - clusterLocation
-                            - clusterName
                             - serviceAccountRef
                             type: object
                         type: object

+ 9 - 2
config/crds/bases/external-secrets.io_secretstores.yaml

@@ -3794,10 +3794,19 @@ spec:
                           workloadIdentity:
                             properties:
                               clusterLocation:
+                                description: |-
+                                  ClusterLocation is the location of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               clusterName:
+                                description: |-
+                                  ClusterName is the name of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               clusterProjectID:
+                                description: |-
+                                  ClusterProjectID is the project ID of the cluster
+                                  If not specified, it fetches information from the metadata server
                                 type: string
                               serviceAccountRef:
                                 description: A reference to a ServiceAccount resource.
@@ -3829,8 +3838,6 @@ spec:
                                 - name
                                 type: object
                             required:
-                            - clusterLocation
-                            - clusterName
                             - serviceAccountRef
                             type: object
                         type: object

+ 9 - 2
deploy/charts/external-secrets/tests/__snapshot__/crds_test.yaml.snap

@@ -3576,10 +3576,19 @@ should match snapshot of default values:
                                 workloadIdentity:
                                   properties:
                                     clusterLocation:
+                                      description: |-
+                                        ClusterLocation is the location of the cluster
+                                        If not specified, it fetches information from the metadata server
                                       type: string
                                     clusterName:
+                                      description: |-
+                                        ClusterName is the name of the cluster
+                                        If not specified, it fetches information from the metadata server
                                       type: string
                                     clusterProjectID:
+                                      description: |-
+                                        ClusterProjectID is the project ID of the cluster
+                                        If not specified, it fetches information from the metadata server
                                       type: string
                                     serviceAccountRef:
                                       description: A reference to a ServiceAccount resource.
@@ -3610,8 +3619,6 @@ should match snapshot of default values:
                                         - name
                                       type: object
                                   required:
-                                    - clusterLocation
-                                    - clusterName
                                     - serviceAccountRef
                                   type: object
                               type: object

+ 18 - 4
deploy/crds/bundle.yaml

@@ -4829,10 +4829,19 @@ spec:
                             workloadIdentity:
                               properties:
                                 clusterLocation:
+                                  description: |-
+                                    ClusterLocation is the location of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 clusterName:
+                                  description: |-
+                                    ClusterName is the name of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 clusterProjectID:
+                                  description: |-
+                                    ClusterProjectID is the project ID of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 serviceAccountRef:
                                   description: A reference to a ServiceAccount resource.
@@ -4863,8 +4872,6 @@ spec:
                                     - name
                                   type: object
                               required:
-                                - clusterLocation
-                                - clusterName
                                 - serviceAccountRef
                               type: object
                           type: object
@@ -12160,10 +12167,19 @@ spec:
                             workloadIdentity:
                               properties:
                                 clusterLocation:
+                                  description: |-
+                                    ClusterLocation is the location of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 clusterName:
+                                  description: |-
+                                    ClusterName is the name of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 clusterProjectID:
+                                  description: |-
+                                    ClusterProjectID is the project ID of the cluster
+                                    If not specified, it fetches information from the metadata server
                                   type: string
                                 serviceAccountRef:
                                   description: A reference to a ServiceAccount resource.
@@ -12194,8 +12210,6 @@ spec:
                                     - name
                                   type: object
                               required:
-                                - clusterLocation
-                                - clusterName
                                 - serviceAccountRef
                               type: object
                           type: object

+ 9 - 0
docs/api/spec.md

@@ -4668,6 +4668,9 @@ string
 </em>
 </td>
 <td>
+<em>(Optional)</em>
+<p>ClusterLocation is the location of the cluster
+If not specified, it fetches information from the metadata server</p>
 </td>
 </tr>
 <tr>
@@ -4678,6 +4681,9 @@ string
 </em>
 </td>
 <td>
+<em>(Optional)</em>
+<p>ClusterName is the name of the cluster
+If not specified, it fetches information from the metadata server</p>
 </td>
 </tr>
 <tr>
@@ -4688,6 +4694,9 @@ string
 </em>
 </td>
 <td>
+<em>(Optional)</em>
+<p>ClusterProjectID is the project ID of the cluster
+If not specified, it fetches information from the metadata server</p>
 </td>
 </tr>
 </tbody>