diff --git a/apis/gkehub/v1beta1/featuremembership_types.go b/apis/gkehub/v1beta1/featuremembership_types.go index 4138091a73..e89faf3212 100644 --- a/apis/gkehub/v1beta1/featuremembership_types.go +++ b/apis/gkehub/v1beta1/featuremembership_types.go @@ -59,6 +59,10 @@ type FeaturemembershipConfigSync struct { /* Specifies whether the Config Sync Repo is in "hierarchical" or "unstructured" mode. */ // +optional SourceFormat *string `json:"sourceFormat,omitempty"` + + /* Set to true to stop syncing configurations for a single cluster. This field is only available on clusters using Config Sync auto-upgrades or on Config Sync version 1.20.0 or later. Defaults: false. */ + // +optional + StopSyncing *bool `json:"stopSyncing,omitempty"` } type FeaturemembershipConfigmanagement struct { diff --git a/apis/gkehub/v1beta1/zz_generated.deepcopy.go b/apis/gkehub/v1beta1/zz_generated.deepcopy.go index 5e8279a456..91740390b4 100644 --- a/apis/gkehub/v1beta1/zz_generated.deepcopy.go +++ b/apis/gkehub/v1beta1/zz_generated.deepcopy.go @@ -102,6 +102,11 @@ func (in *FeaturemembershipConfigSync) DeepCopyInto(out *FeaturemembershipConfig *out = new(string) **out = **in } + if in.StopSyncing != nil { + in, out := &in.StopSyncing, &out.StopSyncing + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeaturemembershipConfigSync. diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_gkehubfeaturememberships.gkehub.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_gkehubfeaturememberships.gkehub.cnrm.cloud.google.com.yaml index 3abee46d32..7f4f94baa6 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_gkehubfeaturememberships.gkehub.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_gkehubfeaturememberships.gkehub.cnrm.cloud.google.com.yaml @@ -226,6 +226,12 @@ spec: description: Specifies whether the Config Sync Repo is in "hierarchical" or "unstructured" mode. type: string + stopSyncing: + description: 'Set to true to stop syncing configurations for + a single cluster. This field is only available on clusters + using Config Sync auto-upgrades or on Config Sync version + 1.20.0 or later. Defaults: false.' + type: boolean type: object hierarchyController: description: Hierarchy Controller is no longer available. Use diff --git a/pkg/controller/direct/gkehub/acmconversion.go b/pkg/controller/direct/gkehub/acmconversion.go index 016b584dd2..e1781e2015 100644 --- a/pkg/controller/direct/gkehub/acmconversion.go +++ b/pkg/controller/direct/gkehub/acmconversion.go @@ -143,6 +143,9 @@ func convertKRMtoAPI_ConfigSync(r *krm.FeaturemembershipConfigSync) (*featureapi if r.SourceFormat != nil { apiObj.SourceFormat = *r.SourceFormat } + if r.StopSyncing != nil { + apiObj.StopSyncing = *r.StopSyncing + } return &apiObj, nil } diff --git a/pkg/controller/direct/gkehub/diffs.go b/pkg/controller/direct/gkehub/diffs.go index 9d77d122ff..f5688f7cb2 100644 --- a/pkg/controller/direct/gkehub/diffs.go +++ b/pkg/controller/direct/gkehub/diffs.go @@ -117,6 +117,9 @@ func diffConfigSync(left *krm.FeaturemembershipConfigSync, right *featureapi.Con if left.PreventDrift != nil && !reflect.DeepEqual(left.PreventDrift, right.PreventDrift) { diffs = append(diffs, "preventDrift") } + if left.StopSyncing != nil && !reflect.DeepEqual(left.StopSyncing, right.StopSyncing) { + diffs = append(diffs, "stopSyncing") + } if left.SourceFormat != nil && !reflect.DeepEqual(left.SourceFormat, right.SourceFormat) { diffs = append(diffs, "sourceFormat") } diff --git a/pkg/controller/direct/gkehub/mappings.go b/pkg/controller/direct/gkehub/mappings.go index 2f8effd029..792931e8b7 100644 --- a/pkg/controller/direct/gkehub/mappings.go +++ b/pkg/controller/direct/gkehub/mappings.go @@ -120,6 +120,7 @@ func ConfigSyncMembershipSpec_FromProto(mapCtx *direct.MapContext, r *api.Config out := &krm.FeaturemembershipConfigSync{} out.PreventDrift = direct.LazyPtr(r.PreventDrift) + out.StopSyncing = direct.LazyPtr(r.StopSyncing) out.SourceFormat = direct.LazyPtr(r.SourceFormat) out.Git = GitMembershipSpec_FromProto(mapCtx, r.Git) out.Oci = OciMembershipSpec_FromProto(mapCtx, r.Oci) diff --git a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_generated_object_basicacmgkehubfeaturemembership.golden.yaml b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_generated_object_basicacmgkehubfeaturemembership.golden.yaml index d154a1a2a4..ff7b7336c3 100644 --- a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_generated_object_basicacmgkehubfeaturemembership.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_generated_object_basicacmgkehubfeaturemembership.golden.yaml @@ -25,7 +25,8 @@ spec: syncRev: HEAD syncWaitSecs: "20" sourceFormat: hierarchy - version: 1.18.2 + stopSyncing: true + version: 1.20.0 featureRef: name: gkehubfeature-basic-acm-${uniqueId} location: global diff --git a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_http.log b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_http.log index 8c21f788b1..a3c610cf19 100644 --- a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_http.log +++ b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/_http.log @@ -1461,7 +1461,7 @@ User-Agent: kcc/controller-manager "configSync": { "sourceFormat": "unstructured" }, - "version": "1.18.1" + "version": "1.19.2" } } }, @@ -1526,7 +1526,7 @@ X-Xss-Protection: 0 "configSync": { "sourceFormat": "unstructured" }, - "version": "1.18.1" + "version": "1.19.2" } } }, @@ -1565,7 +1565,7 @@ X-Xss-Protection: 0 "configSync": { "sourceFormat": "unstructured" }, - "version": "1.18.1" + "version": "1.19.2" } } }, @@ -1598,9 +1598,10 @@ User-Agent: kcc/controller-manager "syncRev": "HEAD", "syncWaitSecs": "20" }, - "sourceFormat": "hierarchy" + "sourceFormat": "hierarchy", + "stopSyncing": true }, - "version": "1.18.2" + "version": "1.20.0" } } }, @@ -1676,7 +1677,7 @@ X-Xss-Protection: 0 }, "sourceFormat": "hierarchy" }, - "version": "1.18.2" + "version": "1.20.0" } } }, @@ -1725,7 +1726,7 @@ X-Xss-Protection: 0 }, "sourceFormat": "hierarchy" }, - "version": "1.18.2" + "version": "1.20.0" } } }, diff --git a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/create.yaml b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/create.yaml index f2d12b00fe..b7383167e9 100644 --- a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/create.yaml @@ -28,4 +28,5 @@ spec: configmanagement: configSync: sourceFormat: unstructured - version: "1.18.1" + stopSyncing: false + version: "1.19.2" diff --git a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/update.yaml b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/update.yaml index a7812cb251..26af93ae1d 100644 --- a/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/gkehub/v1beta1/gkehubfeaturemembership/basicacmgkehubfeaturemembership/update.yaml @@ -28,6 +28,7 @@ spec: configmanagement: configSync: sourceFormat: hierarchy + stopSyncing: true git: gcpServiceAccountRef: name: sa-${uniqueId} @@ -38,5 +39,5 @@ spec: syncWaitSecs: "20" syncRev: "HEAD" secretType: "none" - version: "1.18.2" + version: "1.20.0" diff --git a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/gkehub/gkehubfeaturemembership.md b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/gkehub/gkehubfeaturemembership.md index 8ee2be6f5a..235f6ce332 100644 --- a/scripts/generate-google3-docs/resource-reference/generated/resource-docs/gkehub/gkehubfeaturemembership.md +++ b/scripts/generate-google3-docs/resource-reference/generated/resource-docs/gkehub/gkehubfeaturemembership.md @@ -97,6 +97,7 @@ configmanagement: syncWaitSecs: string preventDrift: boolean sourceFormat: string + stopSyncing: boolean hierarchyController: enableHierarchicalResourceQuota: boolean enablePodTreeLabels: boolean @@ -468,6 +469,16 @@ projectRef:
{% verbatim %}Specifies whether the Config Sync Repo is in "hierarchical" or "unstructured" mode.{% endverbatim %}
+configmanagement.configSync.stopSyncing
Optional
+boolean
{% verbatim %}Set to true to stop syncing configurations for a single cluster. This field is only available on clusters using Config Sync auto-upgrades or on Config Sync version 1.20.0 or later. Defaults: false.{% endverbatim %}
+configmanagement.hierarchyController