From e22ad86f594732443122ce4add36d53f1907d8b0 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Sun, 16 Jun 2024 23:44:59 +0000 Subject: [PATCH] Chore: change CBWP 'Ip' to 'IP' --- apis/cloudbuild/v1alpha1/conversion.go | 4 ++-- apis/cloudbuild/v1alpha1/workerpool_types.go | 4 ++-- ...workerpools.cloudbuild.cnrm.cloud.google.com.yaml | 6 +++--- .../v1alpha1/cloudbuildworkerpool_types.go | 6 +++--- .../cloudbuild/v1alpha1/zz_generated.deepcopy.go | 12 ++++++------ .../direct/cloudbuild/workerpool_controller.go | 2 +- ...generated_object_cloudbuildworkerpool.golden.yaml | 4 ++-- .../v1alpha1/cloudbuildworkerpool/create.yaml | 2 +- .../v1alpha1/cloudbuildworkerpool/update.yaml | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apis/cloudbuild/v1alpha1/conversion.go b/apis/cloudbuild/v1alpha1/conversion.go index d47c3dc00e..768b96cbb3 100644 --- a/apis/cloudbuild/v1alpha1/conversion.go +++ b/apis/cloudbuild/v1alpha1/conversion.go @@ -63,7 +63,7 @@ func Convert_NetworkConfig_API_v1_To_KRM(in *cloudbuildpb.PrivatePoolV1Config_Ne } out.PeeredNetwork = in.PeeredNetwork - out.PeeredNetworkIpRange = in.PeeredNetworkIpRange + out.PeeredNetworkIPRange = in.PeeredNetworkIpRange return nil } @@ -119,7 +119,7 @@ func Convert_PrivatePoolV1Config_NetworkConfig_KRM_To_API_v1(in *NetworkConfig, return nil } obj := in.DeepCopy() - out.PeeredNetworkIpRange = obj.PeeredNetworkIpRange + out.PeeredNetworkIpRange = obj.PeeredNetworkIPRange // custom switch obj.EgressOption { diff --git a/apis/cloudbuild/v1alpha1/workerpool_types.go b/apis/cloudbuild/v1alpha1/workerpool_types.go index b98f8842a7..3bee5dc546 100644 --- a/apis/cloudbuild/v1alpha1/workerpool_types.go +++ b/apis/cloudbuild/v1alpha1/workerpool_types.go @@ -55,7 +55,7 @@ type NetworkConfig struct { // +optional EgressOption string `json:"egressOption,omitempty"` // +optional - PeeredNetworkIpRange string `json:"peeredNetworkIpRange,omitempty"` + PeeredNetworkIPRange string `json:"PeeredNetworkIPRange,omitempty"` } // CloudBuildWorkerPoolStatus defines the observed state of Instance @@ -96,7 +96,7 @@ type NetworkConfigState struct { // +optional EgressOption string `json:"egressOption,omitempty"` // +optional - PeeredNetworkIpRange string `json:"peeredNetworkIpRange,omitempty"` + PeeredNetworkIPRange string `json:"peeredNetworkIPRange,omitempty"` } // +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/stability-level=beta" diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_cloudbuildworkerpools.cloudbuild.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_cloudbuildworkerpools.cloudbuild.cnrm.cloud.google.com.yaml index 2fc2ff23de..a6633a180d 100644 --- a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_cloudbuildworkerpools.cloudbuild.cnrm.cloud.google.com.yaml +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_cloudbuildworkerpools.cloudbuild.cnrm.cloud.google.com.yaml @@ -49,9 +49,9 @@ spec: properties: networkConfig: properties: - egressOption: + PeeredNetworkIPRange: type: string - peeredNetworkIpRange: + egressOption: type: string peeredNetworkRef: oneOf: @@ -186,7 +186,7 @@ spec: type: string peeredNetwork: type: string - peeredNetworkIpRange: + peeredNetworkIPRange: type: string type: object updateTime: diff --git a/pkg/clients/generated/apis/cloudbuild/v1alpha1/cloudbuildworkerpool_types.go b/pkg/clients/generated/apis/cloudbuild/v1alpha1/cloudbuildworkerpool_types.go index 19a5a29924..a425b1e2f4 100644 --- a/pkg/clients/generated/apis/cloudbuild/v1alpha1/cloudbuildworkerpool_types.go +++ b/pkg/clients/generated/apis/cloudbuild/v1alpha1/cloudbuildworkerpool_types.go @@ -37,10 +37,10 @@ import ( type WorkerpoolNetworkConfig struct { // +optional - EgressOption *string `json:"egressOption,omitempty"` + PeeredNetworkIPRange *string `json:"PeeredNetworkIPRange,omitempty"` // +optional - PeeredNetworkIpRange *string `json:"peeredNetworkIpRange,omitempty"` + EgressOption *string `json:"egressOption,omitempty"` PeeredNetworkRef v1alpha1.ResourceRef `json:"peeredNetworkRef"` } @@ -86,7 +86,7 @@ type WorkerpoolNetworkConfigStatus struct { PeeredNetwork *string `json:"peeredNetwork,omitempty"` // +optional - PeeredNetworkIpRange *string `json:"peeredNetworkIpRange,omitempty"` + PeeredNetworkIPRange *string `json:"peeredNetworkIPRange,omitempty"` } type WorkerpoolObservedStateStatus struct { diff --git a/pkg/clients/generated/apis/cloudbuild/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/cloudbuild/v1alpha1/zz_generated.deepcopy.go index ba89cb99dc..4e12f28d3e 100644 --- a/pkg/clients/generated/apis/cloudbuild/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/cloudbuild/v1alpha1/zz_generated.deepcopy.go @@ -162,13 +162,13 @@ func (in *CloudBuildWorkerPoolStatus) DeepCopy() *CloudBuildWorkerPoolStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *WorkerpoolNetworkConfig) DeepCopyInto(out *WorkerpoolNetworkConfig) { *out = *in - if in.EgressOption != nil { - in, out := &in.EgressOption, &out.EgressOption + if in.PeeredNetworkIPRange != nil { + in, out := &in.PeeredNetworkIPRange, &out.PeeredNetworkIPRange *out = new(string) **out = **in } - if in.PeeredNetworkIpRange != nil { - in, out := &in.PeeredNetworkIpRange, &out.PeeredNetworkIpRange + if in.EgressOption != nil { + in, out := &in.EgressOption, &out.EgressOption *out = new(string) **out = **in } @@ -199,8 +199,8 @@ func (in *WorkerpoolNetworkConfigStatus) DeepCopyInto(out *WorkerpoolNetworkConf *out = new(string) **out = **in } - if in.PeeredNetworkIpRange != nil { - in, out := &in.PeeredNetworkIpRange, &out.PeeredNetworkIpRange + if in.PeeredNetworkIPRange != nil { + in, out := &in.PeeredNetworkIPRange, &out.PeeredNetworkIPRange *out = new(string) **out = **in } diff --git a/pkg/controller/direct/cloudbuild/workerpool_controller.go b/pkg/controller/direct/cloudbuild/workerpool_controller.go index fce6fee12f..41e998dace 100644 --- a/pkg/controller/direct/cloudbuild/workerpool_controller.go +++ b/pkg/controller/direct/cloudbuild/workerpool_controller.go @@ -230,7 +230,7 @@ func (a *Adapter) Update(ctx context.Context, u *unstructured.Unstructured) erro updateMask.Paths = append(updateMask.Paths, "private_pool_v1_config.network_config.egress_option") } } - expectedIPRange := desiredConfig.NetworkConfig.PeeredNetworkIpRange + expectedIPRange := desiredConfig.NetworkConfig.PeeredNetworkIPRange if expectedIPRange != "" && !reflect.DeepEqual(expectedIPRange, actualConfig.NetworkConfig.PeeredNetworkIpRange) { updateMask.Paths = append(updateMask.Paths, "private_pool_v1_config.network_config.peered_network_ip_range") } diff --git a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/_generated_object_cloudbuildworkerpool.golden.yaml b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/_generated_object_cloudbuildworkerpool.golden.yaml index 843b50127f..3acbb4ad51 100644 --- a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/_generated_object_cloudbuildworkerpool.golden.yaml +++ b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/_generated_object_cloudbuildworkerpool.golden.yaml @@ -14,8 +14,8 @@ spec: location: us-central1 privatePoolV1Config: networkConfig: + PeeredNetworkIPRange: /29 egressOption: NO_PUBLIC_EGRESS - peeredNetworkIpRange: /29 peeredNetworkRef: external: projects/${projectId}/global/networks/computenetwork-${uniqueId} workerConfig: @@ -36,7 +36,7 @@ status: networkConfig: egressOption: NO_PUBLIC_EGRESS peeredNetwork: projects/${projectId}/global/networks/computenetwork-${uniqueId} - peeredNetworkIpRange: /29 + peeredNetworkIPRange: /29 updateTime: "1970-01-01T00:00:00Z" workerConfig: diskSizeGb: 100 diff --git a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/create.yaml b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/create.yaml index 312d9f94b2..4af9dbebef 100644 --- a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/create.yaml +++ b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/create.yaml @@ -28,5 +28,5 @@ spec: peeredNetworkRef: external: projects/${projectId}/global/networks/computenetwork-${uniqueId} egressOption: NO_PUBLIC_EGRESS - peeredNetworkIpRange: /29 + PeeredNetworkIPRange: /29 diff --git a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/update.yaml b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/update.yaml index 95df04dcb9..00d69c8036 100644 --- a/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/update.yaml +++ b/pkg/test/resourcefixture/testdata/basic/cloudbuild/v1alpha1/cloudbuildworkerpool/update.yaml @@ -28,5 +28,5 @@ spec: peeredNetworkRef: external: projects/${projectId}/global/networks/computenetwork-${uniqueId} egressOption: NO_PUBLIC_EGRESS - peeredNetworkIpRange: /29 + PeeredNetworkIPRange: /29