Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Jul 11, 2024
1 parent e88b5dc commit 230837e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
14 changes: 5 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ replace (
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
//github.com/vmware/vsphere-automation-sdk-go/lib => github.com/zhengxiexie/vsphere-automation-sdk-go/lib v0.7.3-0.20240628090521-3ad1af047210
//github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/zhengxiexie/vsphere-automation-sdk-go/runtime v0.7.3-0.20240628090521-3ad1af047210
//github.com/vmware/vsphere-automation-sdk-go/services/nsxt => github.com/zhengxiexie/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240628090521-3ad1af047210
//github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp => github.com/zhengxiexie/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240628090521-3ad1af047210
github.com/vmware/vsphere-automation-sdk-go/lib => github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240707161013-a8f39aba7c1e
github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240707161013-a8f39aba7c1e
github.com/vmware/vsphere-automation-sdk-go/services/nsxt => github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240707161013-a8f39aba7c1e
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp => github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240707161013-a8f39aba7c1e
github.com/vmware/vsphere-automation-sdk-go/lib => github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240711034503-a008ff3b1f16
github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240711034503-a008ff3b1f16
github.com/vmware/vsphere-automation-sdk-go/services/nsxt => github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240711034503-a008ff3b1f16
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp => github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240711034503-a008ff3b1f16
)

require (
Expand Down Expand Up @@ -49,6 +45,7 @@ require (
k8s.io/apimachinery v0.29.3
k8s.io/client-go v0.29.3
k8s.io/code-generator v0.29.3
k8s.io/klog/v2 v2.110.1
sigs.k8s.io/controller-runtime v0.16.0
)

Expand Down Expand Up @@ -104,7 +101,6 @@ require (
k8s.io/apiextensions-apiserver v0.29.3 // indirect
k8s.io/component-base v0.29.3 // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ github.com/vmware-tanzu/vm-operator/api v1.8.2/go.mod h1:vauVboD3sQxP+pb28TnI9wf
github.com/vmware/govmomi v0.27.4 h1:5kY8TAkhB20lsjzrjE073eRb8+HixBI29PVMG5lxq6I=
github.com/vmware/govmomi v0.27.4/go.mod h1:daTuJEcQosNMXYJOeku0qdBJP9SOLLWB3Mqz8THtv6o=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240707161013-a8f39aba7c1e h1:ZZaRftnZ4DP+220Ga4U6Y3/Vw5VXJ96xILvY0IOD1Wc=
github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240707161013-a8f39aba7c1e/go.mod h1:x4s3xpeRcJk6PTx9Xyb3LSDzHMLz9BKsA708vmss7MQ=
github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240707161013-a8f39aba7c1e h1:4GPHMUuBv7uPhg0bqwu3B/i1VZiIxOM8qHlEp58HLWk=
github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240707161013-a8f39aba7c1e/go.mod h1:DzLetYAmw1+vj7bqElRWEpuy40WYE/woL3alsymYa/c=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240707161013-a8f39aba7c1e h1:CxFT1A9bYXCj65epb0JYq3p2l4MearOvS0wn89WG0sk=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240707161013-a8f39aba7c1e/go.mod h1:5svFmx8JLpYUwXiAevMJ3mcu+OmEkBp/t3TlMXXbovw=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240707161013-a8f39aba7c1e h1:Qh0W4qbqiEOV9+HUxHRPz/uFfC/2g6Zr0LUjJRwIpME=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240707161013-a8f39aba7c1e/go.mod h1:KAXagEsQzxWVrf/W1FejwoGI0TFqCvtAlTl4skHnpU4=
github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240711034503-a008ff3b1f16 h1:KSgWYactid4NnlAlmZS+P+U5xW8Ci6UFrTz+RE3lEcc=
github.com/wenqiq/vsphere-automation-sdk-go/lib v0.7.3-0.20240711034503-a008ff3b1f16/go.mod h1:x4s3xpeRcJk6PTx9Xyb3LSDzHMLz9BKsA708vmss7MQ=
github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240711034503-a008ff3b1f16 h1:T/SlpoW90WLCBDObwHD6oEz2j8jGFQ3sH+3p3owB/CQ=
github.com/wenqiq/vsphere-automation-sdk-go/runtime v0.7.3-0.20240711034503-a008ff3b1f16/go.mod h1:DzLetYAmw1+vj7bqElRWEpuy40WYE/woL3alsymYa/c=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240711034503-a008ff3b1f16 h1:0kplISkgha3t4yocB+4K4mrkaaDmg3zvOWyYJSC0tC8=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt v0.12.3-0.20240711034503-a008ff3b1f16/go.mod h1:5svFmx8JLpYUwXiAevMJ3mcu+OmEkBp/t3TlMXXbovw=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240711034503-a008ff3b1f16 h1:1wRbltM387/RLbqeS+Im5Kk/6YSSUC3dqeeKpD92ehk=
github.com/wenqiq/vsphere-automation-sdk-go/services/nsxt-mp v0.6.3-0.20240711034503-a008ff3b1f16/go.mod h1:KAXagEsQzxWVrf/W1FejwoGI0TFqCvtAlTl4skHnpU4=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
Expand Down
12 changes: 6 additions & 6 deletions pkg/nsx/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ type Client struct {
}

var (
nsx320Version = [3]int64{3, 2, 0}
nsx401Version = [3]int64{4, 0, 1}
nsx411Version = [3]int64{4, 1, 1}
nsx412Version = [3]int64{4, 1, 2}
nsx413Version = [3]int64{4, 1, 3}
nsx421Version = [3]int64{4, 2, 1}
nsx320Version = [3]int64{3, 2, 0}
nsx401Version = [3]int64{4, 0, 1}
nsx411Version = [3]int64{4, 1, 1}
nsx412Version = [3]int64{4, 1, 2}
nsx413Version = [3]int64{4, 1, 3}
nsxWithNodeTypeVersion = [3]int64{9, 0, 0}
)

type NSXHealthChecker struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/nsx/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ func (nsxVersion *NsxVersion) featureSupported(feature int) bool {
minVersion = nsx411Version
validFeature = true
case NodeType:
minVersion = nsx421Version
minVersion = nsxWithNodeTypeVersion
validFeature = true
}

Expand Down
9 changes: 6 additions & 3 deletions pkg/nsx/services/nsxserviceaccount/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,21 @@ func (s *NSXServiceAccountService) createPIAndCCP(normalizedClusterName string,
hasCCP := len(s.ClusterControlPlaneStore.GetByIndex(common.TagScopeNSXServiceAccountCRUID, string(obj.UID))) > 0
clusterId := ""
if ccpObj := s.ClusterControlPlaneStore.GetByKey(normalizedClusterName); !hasCCP && ccpObj == nil {
ccp, err := s.NSXClient.ClusterControlPlanesClient.Update(siteId, enforcementpointId, normalizedClusterName, model.ClusterControlPlane{
modelCCP := model.ClusterControlPlane{
Revision: &revision1,
ResourceType: &antreaClusterResourceType,
Certificate: &cert,
VhcPath: &vpcPath,
NodeId: existingClusterId,
Tags: s.buildBasicTags(obj),
})
}

if s.NSXClient.NSXCheckVersion(nsx.NodeType) {
ccp.NodeType = &nodeTypeAntrea
modelCCP.NodeType = &nodeTypeAntrea
}

ccp, err := s.NSXClient.ClusterControlPlanesClient.Update(siteId, enforcementpointId, normalizedClusterName, modelCCP)

err = nsxutil.NSXApiError(err)
if err != nil {
return "", err
Expand Down

0 comments on commit 230837e

Please sign in to comment.