From f4c401d7e048898870aeda4d94ec07aa95ced739 Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Fri, 19 Jul 2024 07:47:27 +0800 Subject: [PATCH] Update field name Signed-off-by: Wenqi Qiu --- build/yaml/crd/nsx.vmware.com_subnets.yaml | 4 ++-- build/yaml/crd/nsx.vmware.com_subnetsets.yaml | 4 ++-- ...sx.vmware.com_vpcnetworkconfigurations.yaml | 2 +- .../nsx.vmware.com/v1alpha1/subnet_types.go | 2 +- .../nsx.vmware.com/v1alpha1/subnetset_types.go | 2 +- .../v1alpha1/vpcnetworkconfiguration_types.go | 18 +++++++++--------- pkg/apis/v1alpha1/subnet_types.go | 2 +- pkg/apis/v1alpha1/subnetset_types.go | 2 +- .../v1alpha1/vpcnetworkconfiguration_types.go | 18 +++++++++--------- .../networkinfo/vpcnetworkconfig_handler.go | 2 +- pkg/nsx/services/common/types.go | 2 +- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/build/yaml/crd/nsx.vmware.com_subnets.yaml b/build/yaml/crd/nsx.vmware.com_subnets.yaml index 46a838be1..3fac19d3a 100644 --- a/build/yaml/crd/nsx.vmware.com_subnets.yaml +++ b/build/yaml/crd/nsx.vmware.com_subnets.yaml @@ -60,11 +60,11 @@ spec: type: boolean type: object accessMode: - default: Private + default: Private_TGW description: Access mode of Subnet, accessible only from within VPC or from outside VPC. enum: - - Private + - Private_TGW - Public - Project type: string diff --git a/build/yaml/crd/nsx.vmware.com_subnetsets.yaml b/build/yaml/crd/nsx.vmware.com_subnetsets.yaml index f6ffc81b7..d7b9edc6b 100644 --- a/build/yaml/crd/nsx.vmware.com_subnetsets.yaml +++ b/build/yaml/crd/nsx.vmware.com_subnetsets.yaml @@ -60,11 +60,11 @@ spec: type: boolean type: object accessMode: - default: Private + default: Private_TGW description: Access mode of Subnet, accessible only from within VPC or from outside VPC. enum: - - Private + - Private_TGW - Public - Project type: string diff --git a/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml b/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml index 07ecf0e31..554d8b04f 100644 --- a/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml +++ b/build/yaml/crd/nsx.vmware.com_vpcnetworkconfigurations.yaml @@ -76,7 +76,7 @@ spec: Must be Public or Private. enum: - Public - - Private + - Private_TGW - Project type: string privateIPs: diff --git a/pkg/apis/nsx.vmware.com/v1alpha1/subnet_types.go b/pkg/apis/nsx.vmware.com/v1alpha1/subnet_types.go index 82ecdb839..eb7b9f681 100644 --- a/pkg/apis/nsx.vmware.com/v1alpha1/subnet_types.go +++ b/pkg/apis/nsx.vmware.com/v1alpha1/subnet_types.go @@ -17,7 +17,7 @@ type SubnetSpec struct { IPv4SubnetSize int `json:"ipv4SubnetSize,omitempty"` // Access mode of Subnet, accessible only from within VPC or from outside VPC. // +kubebuilder:default:=Private - // +kubebuilder:validation:Enum=Private;Public;Project + // +kubebuilder:validation:Enum=Private;Public;PrivateTGW AccessMode AccessMode `json:"accessMode,omitempty"` // Subnet CIDRS. // +kubebuilder:validation:MinItems=0 diff --git a/pkg/apis/nsx.vmware.com/v1alpha1/subnetset_types.go b/pkg/apis/nsx.vmware.com/v1alpha1/subnetset_types.go index 275db8762..e85e90333 100644 --- a/pkg/apis/nsx.vmware.com/v1alpha1/subnetset_types.go +++ b/pkg/apis/nsx.vmware.com/v1alpha1/subnetset_types.go @@ -15,7 +15,7 @@ type SubnetSetSpec struct { IPv4SubnetSize int `json:"ipv4SubnetSize,omitempty"` // Access mode of Subnet, accessible only from within VPC or from outside VPC. // +kubebuilder:default:=Private - // +kubebuilder:validation:Enum=Private;Public;Project + // +kubebuilder:validation:Enum=Private;Public;PrivateTGW AccessMode AccessMode `json:"accessMode,omitempty"` // Subnet advanced configuration. AdvancedConfig AdvancedConfig `json:"advancedConfig,omitempty"` diff --git a/pkg/apis/nsx.vmware.com/v1alpha1/vpcnetworkconfiguration_types.go b/pkg/apis/nsx.vmware.com/v1alpha1/vpcnetworkconfiguration_types.go index e17d46e06..046d13461 100644 --- a/pkg/apis/nsx.vmware.com/v1alpha1/vpcnetworkconfiguration_types.go +++ b/pkg/apis/nsx.vmware.com/v1alpha1/vpcnetworkconfiguration_types.go @@ -9,13 +9,13 @@ import ( ) const ( - AccessModePublic string = "Public" - AccessModePrivate string = "Private" - AccessModeProject string = "Project" - LbServiceSizeSmall string = "SMALL" - LbServiceSizeMedium string = "MEDIUM" - LbServiceSizeLarge string = "LARGE" - LbServiceSizeXlarge string = "XLARGE" + AccessModePublic string = "Public" + AccessModePrivate string = "Private" + AccessModeProject string = "PrivateTGW" + LoadBalancerSizeSmall string = "SMALL" + LoadBalancerSizeMedium string = "MEDIUM" + LoadBalancerSizeLarge string = "LARGE" + LoadBalancerSizeXlarge string = "XLARGE" ) // VPCNetworkConfigurationSpec defines the desired state of VPCNetworkConfiguration. @@ -49,7 +49,7 @@ type VPCNetworkConfigurationSpec struct { VPC string `json:"vpc,omitempty"` // +kubebuilder:validation:Enum=SMALL;MEDIUM;LARGE;XLARGE - LbServiceSize string `json:"lbServiceSize,omitempty"` + LoadBalancerSize string `json:"lbServiceSize,omitempty"` // Default size of Subnet based upon estimated workload count. // Defaults to 26. @@ -57,7 +57,7 @@ type VPCNetworkConfigurationSpec struct { DefaultSubnetSize int `json:"defaultSubnetSize,omitempty"` // PodSubnetAccessMode defines the access mode of the default SubnetSet for PodVM. // Must be Public or Private. - // +kubebuilder:validation:Enum=Public;Private;Project + // +kubebuilder:validation:Enum=Public;Private;PrivateTGW PodSubnetAccessMode string `json:"podSubnetAccessMode,omitempty"` } diff --git a/pkg/apis/v1alpha1/subnet_types.go b/pkg/apis/v1alpha1/subnet_types.go index 82ecdb839..eb7b9f681 100644 --- a/pkg/apis/v1alpha1/subnet_types.go +++ b/pkg/apis/v1alpha1/subnet_types.go @@ -17,7 +17,7 @@ type SubnetSpec struct { IPv4SubnetSize int `json:"ipv4SubnetSize,omitempty"` // Access mode of Subnet, accessible only from within VPC or from outside VPC. // +kubebuilder:default:=Private - // +kubebuilder:validation:Enum=Private;Public;Project + // +kubebuilder:validation:Enum=Private;Public;PrivateTGW AccessMode AccessMode `json:"accessMode,omitempty"` // Subnet CIDRS. // +kubebuilder:validation:MinItems=0 diff --git a/pkg/apis/v1alpha1/subnetset_types.go b/pkg/apis/v1alpha1/subnetset_types.go index 275db8762..e85e90333 100644 --- a/pkg/apis/v1alpha1/subnetset_types.go +++ b/pkg/apis/v1alpha1/subnetset_types.go @@ -15,7 +15,7 @@ type SubnetSetSpec struct { IPv4SubnetSize int `json:"ipv4SubnetSize,omitempty"` // Access mode of Subnet, accessible only from within VPC or from outside VPC. // +kubebuilder:default:=Private - // +kubebuilder:validation:Enum=Private;Public;Project + // +kubebuilder:validation:Enum=Private;Public;PrivateTGW AccessMode AccessMode `json:"accessMode,omitempty"` // Subnet advanced configuration. AdvancedConfig AdvancedConfig `json:"advancedConfig,omitempty"` diff --git a/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go b/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go index e17d46e06..046d13461 100644 --- a/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go +++ b/pkg/apis/v1alpha1/vpcnetworkconfiguration_types.go @@ -9,13 +9,13 @@ import ( ) const ( - AccessModePublic string = "Public" - AccessModePrivate string = "Private" - AccessModeProject string = "Project" - LbServiceSizeSmall string = "SMALL" - LbServiceSizeMedium string = "MEDIUM" - LbServiceSizeLarge string = "LARGE" - LbServiceSizeXlarge string = "XLARGE" + AccessModePublic string = "Public" + AccessModePrivate string = "Private" + AccessModeProject string = "PrivateTGW" + LoadBalancerSizeSmall string = "SMALL" + LoadBalancerSizeMedium string = "MEDIUM" + LoadBalancerSizeLarge string = "LARGE" + LoadBalancerSizeXlarge string = "XLARGE" ) // VPCNetworkConfigurationSpec defines the desired state of VPCNetworkConfiguration. @@ -49,7 +49,7 @@ type VPCNetworkConfigurationSpec struct { VPC string `json:"vpc,omitempty"` // +kubebuilder:validation:Enum=SMALL;MEDIUM;LARGE;XLARGE - LbServiceSize string `json:"lbServiceSize,omitempty"` + LoadBalancerSize string `json:"lbServiceSize,omitempty"` // Default size of Subnet based upon estimated workload count. // Defaults to 26. @@ -57,7 +57,7 @@ type VPCNetworkConfigurationSpec struct { DefaultSubnetSize int `json:"defaultSubnetSize,omitempty"` // PodSubnetAccessMode defines the access mode of the default SubnetSet for PodVM. // Must be Public or Private. - // +kubebuilder:validation:Enum=Public;Private;Project + // +kubebuilder:validation:Enum=Public;Private;PrivateTGW PodSubnetAccessMode string `json:"podSubnetAccessMode,omitempty"` } diff --git a/pkg/controllers/networkinfo/vpcnetworkconfig_handler.go b/pkg/controllers/networkinfo/vpcnetworkconfig_handler.go index cb7a78b9f..bbd0510d7 100644 --- a/pkg/controllers/networkinfo/vpcnetworkconfig_handler.go +++ b/pkg/controllers/networkinfo/vpcnetworkconfig_handler.go @@ -111,7 +111,7 @@ func buildNetworkConfigInfo(vpcConfigCR v1alpha1.VPCNetworkConfiguration) (*comm Name: vpcConfigCR.Name, VpcConnectivityProfile: vpcConfigCR.Spec.VpcConnectivityProfile, VpcServiceProfile: vpcConfigCR.Spec.VpcServiceProfile, - LbServiceSize: vpcConfigCR.Spec.LbServiceSize, + LoadBalancerSize: vpcConfigCR.Spec.LoadBalancerSize, NsxProject: project, PrivateIPs: vpcConfigCR.Spec.PrivateIPs, DefaultSubnetSize: vpcConfigCR.Spec.DefaultSubnetSize, diff --git a/pkg/nsx/services/common/types.go b/pkg/nsx/services/common/types.go index 9f9b7ed62..bef7d52a4 100644 --- a/pkg/nsx/services/common/types.go +++ b/pkg/nsx/services/common/types.go @@ -200,7 +200,7 @@ type VPCNetworkConfigInfo struct { Name string VpcConnectivityProfile string VpcServiceProfile string - LbServiceSize string + LoadBalancerSize string NsxProject string ExternalIPv4Blocks []string PrivateIPs []string