Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <wenqiq@vmware.com>
  • Loading branch information
wenqiq committed Jun 4, 2024
1 parent 479ea7d commit 8e0ab0b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
bin/
.DS_Store
go.work
go.work.sum
go.work.sum
vendor/
.golangci-bin/
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ module github.com/vmware-tanzu/nsx-operator
go 1.21.9

replace (
github.com/vmware-tanzu/nsx-operator/pkg/apis => ./pkg/apis
github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha1 => ./pkg/apis/v1alpha1
github.com/vmware-tanzu/nsx-operator/pkg/apis/v1alpha2 => ./pkg/apis/v1alpha2
github.com/vmware-tanzu/nsx-operator/pkg/client => ./pkg/client
)

replace (
Expand All @@ -19,6 +17,7 @@ require (
github.com/apparentlymart/go-cidr v1.1.0
github.com/deckarep/golang-set v1.8.0
github.com/go-logr/logr v1.3.0
github.com/go-logr/zapr v1.2.4
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
Expand Down Expand Up @@ -58,7 +57,6 @@ require (
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gibson042/canonicaljson-go v1.0.3 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vmware-tanzu/nsx-operator/pkg/client v0.0.0-20240102061654-537b080e159f h1:EV4eiUQr3QpUGfTtqdVph0+bmE+3cj0aNJpd9n2qTdo=
github.com/vmware-tanzu/nsx-operator/pkg/client v0.0.0-20240102061654-537b080e159f/go.mod h1:dzob8tUzpAREQPtbbjQs4b1UyQDR37B2TiIdg8WJSRM=
github.com/vmware-tanzu/vm-operator/api v1.8.2 h1:7cZHVusqAmAMFWvsiU7X5xontxdjasknI/sVfe0p0Z4=
github.com/vmware-tanzu/vm-operator/api v1.8.2/go.mod h1:vauVboD3sQxP+pb28TnI9wfrj+0nH2zSEc9Q7AzWJ54=
github.com/vmware/govmomi v0.27.4 h1:5kY8TAkhB20lsjzrjE073eRb8+HixBI29PVMG5lxq6I=
Expand Down
22 changes: 11 additions & 11 deletions pkg/controllers/networkinfo/vpcnetworkconfig_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ func buildNetworkConfigInfo(vpcConfigCR v1alpha1.VPCNetworkConfiguration) (*comm
}

ninfo := &commontypes.VPCNetworkConfigInfo{
IsDefault: isDefaultNetworkConfigCR(vpcConfigCR),
Org: org,
Name: vpcConfigCR.Name,
DefaultGatewayPath: vpcConfigCR.Spec.DefaultGatewayPath,
EdgeClusterPath: vpcConfigCR.Spec.EdgeClusterPath,
NsxtProject: project,
ExternalIPv4Blocks: vpcConfigCR.Spec.ExternalIPv4Blocks,
PrivateIPv4CIDRs: vpcConfigCR.Spec.PrivateIPv4CIDRs,
DefaultIPv4SubnetSize: vpcConfigCR.Spec.DefaultIPv4SubnetSize,
DefaultSubnetAccessMode: vpcConfigCR.Spec.DefaultSubnetAccessMode,
ShortID: vpcConfigCR.Spec.ShortID,
IsDefault: isDefaultNetworkConfigCR(vpcConfigCR),
Org: org,
Name: vpcConfigCR.Name,
DefaultGatewayPath: vpcConfigCR.Spec.DefaultGatewayPath,
EdgeClusterPath: vpcConfigCR.Spec.EdgeClusterPath,
NsxtProject: project,
ExternalIPv4Blocks: vpcConfigCR.Spec.ExternalIPv4Blocks,
PrivateIPv4CIDRs: vpcConfigCR.Spec.PrivateIPv4CIDRs,
DefaultIPv4SubnetSize: vpcConfigCR.Spec.DefaultIPv4SubnetSize,
DefaultPodSubnetAccessMode: vpcConfigCR.Spec.DefaultPodSubnetAccessMode,
ShortID: vpcConfigCR.Spec.ShortID,
}
return ninfo, nil
}
Expand Down
20 changes: 11 additions & 9 deletions pkg/nsx/services/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@ type VPCResourceInfo struct {
}

type VPCNetworkConfigInfo struct {
IsDefault bool
Org string
Name string
DefaultGatewayPath string
EdgeClusterPath string
NsxtProject string
ExternalIPv4Blocks []string
PrivateIPv4CIDRs []string
DefaultIPv4SubnetSize int
IsDefault bool
Org string
Name string
DefaultGatewayPath string
EdgeClusterPath string
NsxtProject string
ExternalIPv4Blocks []string
PrivateIPv4CIDRs []string
DefaultIPv4SubnetSize int
// DefaultSubnetAccessMode
// DefaultPodSubnetAccessMode
DefaultPodSubnetAccessMode string
ShortID string
}
2 changes: 1 addition & 1 deletion test/e2e/nsx_subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func UserSubnetSet(t *testing.T) {
assertNil(t, err)

// 2. Check `Ipv4SubnetSize` and `AccessMode` should be same with related fields in VPCNetworkConfig.
assertTrue(t, verifySubnetSetCR(UserSubnetSet, "Private"))
assertTrue(t, verifySubnetSetCR(subnetSetName, "Private"))

portPath, _ := filepath.Abs(portYAML)
err = applyYAML(portPath, E2ENamespace)
Expand Down

0 comments on commit 8e0ab0b

Please sign in to comment.