From e8f54f4afb711fb2514c063834ef4a5ae931edaa Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Fri, 9 Aug 2024 14:52:27 +0800 Subject: [PATCH] address comments Signed-off-by: Wenqi Qiu --- build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml | 4 ---- pkg/nsx/services/vpc/vpc.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml b/build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml index b45221eb0..e6802178e 100644 --- a/build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml +++ b/build/yaml/samples/nsx_v1alpha1_vpcnetworkconfigurations.yaml @@ -3,12 +3,8 @@ kind: VPCNetworkConfiguration metadata: name: vpc-network-config1 spec: - defaultGatewayPath: /infra/tier-0s/t0 - edgeClusterPath: /infra/sites/default/enforcement-points/default/edge-clusters/2d9df59f-6dc6-4911-8865-21fadc23d4da defaultSubnetSize: 32 nsxProject: proj-1 - externalIPv4Blocks: - - block1 privateIPs: - 172.26.0.0/16 - 172.36.0.0/16 diff --git a/pkg/nsx/services/vpc/vpc.go b/pkg/nsx/services/vpc/vpc.go index 6ccb8e6be..52c5291de 100644 --- a/pkg/nsx/services/vpc/vpc.go +++ b/pkg/nsx/services/vpc/vpc.go @@ -141,7 +141,7 @@ func (s *VPCService) GetVPCNetworkConfigByNamespace(ns string) *common.VPCNetwor // TBD: for now, if network config info do not contains private cidr, we consider this is // incorrect configuration, and skip creating this VPC CR func (s *VPCService) ValidateNetworkConfig(nc common.VPCNetworkConfigInfo) bool { - return true + return nc.PrivateIPs != nil && len(nc.PrivateIPs) != 0 } // InitializeVPC sync NSX resources