Skip to content

Commit

Permalink
Merge pull request #403 from TaoZou1/update_sdk
Browse files Browse the repository at this point in the history
Update vsphere-automation-sdk-go to offical release
  • Loading branch information
TaoZou1 committed Nov 22, 2023
2 parents bd916d9 + 34ef4f2 commit c2ae596
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
13 changes: 5 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ go 1.19
replace (
github.com/vmware-tanzu/nsx-operator/pkg/apis => ./pkg/apis
github.com/vmware/go-vmware-nsxt => github.com/mengdie-song/go-vmware-nsxt v0.0.0-20220921033217-dbd234470e30 // inventory-keeper includes all commits from github.com/gran-vmv/go-vmware-nsxt v0.0.0-20211206034609-cd7ffaf2c996
github.com/vmware/vsphere-automation-sdk-go/lib => github.com/TaoZou1/vsphere-automation-sdk-go/lib v0.5.4
github.com/vmware/vsphere-automation-sdk-go/runtime => github.com/TaoZou1/vsphere-automation-sdk-go/runtime v0.5.4
github.com/vmware/vsphere-automation-sdk-go/services/nsxt => github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt v0.9.8 // update it from 0.9.5 to 0.9.8 to workaround the relization error for subnetport
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp => github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt-mp v0.3.1-0.20221020082725-84e89979deb6
)

require (
Expand All @@ -30,10 +26,10 @@ require (
github.com/vmware-tanzu/nsx-operator/pkg/apis v0.0.0-00010101000000-000000000000
github.com/vmware-tanzu/vm-operator/api v1.8.2
github.com/vmware/govmomi v0.27.4
github.com/vmware/vsphere-automation-sdk-go/lib v0.5.2
github.com/vmware/vsphere-automation-sdk-go/runtime v0.5.2
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.11.0
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp v0.3.0
github.com/vmware/vsphere-automation-sdk-go/lib v0.7.0
github.com/vmware/vsphere-automation-sdk-go/runtime v0.7.0
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.12.0
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp v0.6.0
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.14.0
golang.org/x/time v0.3.0
Expand All @@ -60,6 +56,7 @@ require (
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/TaoZou1/vsphere-automation-sdk-go/lib v0.5.4 h1:DlmdgfnJZBf3xKVlIzV8hQOoD7Sj207BuNrgJjxzM+I=
github.com/TaoZou1/vsphere-automation-sdk-go/lib v0.5.4/go.mod h1:QJG7MJEjc8SJuo6p++sLJha7Sqt0tzyxjK1peikCB/E=
github.com/TaoZou1/vsphere-automation-sdk-go/runtime v0.5.4 h1:HfPCC2OxVMZjMgfRFD6txpgynbua+roPkMT3f+SoHbA=
github.com/TaoZou1/vsphere-automation-sdk-go/runtime v0.5.4/go.mod h1:GqC85noyNzapJN4vIAO9jJ1EKVo3+jCW4/2VTaMvuSg=
github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt v0.9.8 h1:l8DRN/HDjLyTnePixRhM9Ey5U9RekYXvOcCeOwNwuRk=
github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt v0.9.8/go.mod h1:r6vXdrxnApdHWL8zxnKrWXinGoP8HEXvMVLxKcarV8c=
github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt-mp v0.3.1-0.20221020082725-84e89979deb6 h1:sFObhyzxRrFCQvvZgVbWwAGyxUvhlom14Axv0Cjix90=
github.com/TaoZou1/vsphere-automation-sdk-go/services/nsxt-mp v0.3.1-0.20221020082725-84e89979deb6/go.mod h1:75a9Rt4zCs3FA+pFi5HIMdNvl+5AHUDMCNblLZiErg4=
github.com/a8m/tree v0.0.0-20210115125333-10a5fd5b637d/go.mod h1:FSdwKX97koS5efgm8WevNf7XS3PqtyFkKDDXrz778cg=
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
Expand Down Expand Up @@ -129,6 +121,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog=
github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -195,7 +189,6 @@ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -316,6 +309,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/vmware/vsphere-automation-sdk-go/lib v0.7.0 h1:pT+oqJ8FD5eUBQkl+e7LZwwtbwPvW5kDyyGXvt66gOM=
github.com/vmware/vsphere-automation-sdk-go/lib v0.7.0/go.mod h1:f3+6YVZpNcK2pYyiQ94BoHWmjMj9BnYav0vNFuTiDVM=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.7.0 h1:pSBxa9Agh6bgW8Hr0A1eQxuwnxGTnuAVox8iQb023hg=
github.com/vmware/vsphere-automation-sdk-go/runtime v0.7.0/go.mod h1:qdzEFm2iK3dvlmm99EYYNxs70HbzuiHyENFD24Ps8fQ=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.12.0 h1:+kcDO69bfIB87KZUAYQ4AqrXlnZhpZz+QwzIB+TseqU=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt v0.12.0/go.mod h1:upLH9b9zpG86P0wwO4+gREf0lBXr8gYcs7P1FRZ9n30=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp v0.6.0 h1:+jS0YH9dEp8rC00SsaY5feFpVgp4Lu0YBnBe3T7zfqo=
github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp v0.6.0/go.mod h1:ugk9I4YM62SSAox57l5NAVBCRIkPQ1RNLb3URxyTADc=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -406,7 +407,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
Expand Down
1 change: 0 additions & 1 deletion pkg/nsx/services/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ type Service struct {

func NewConverter() *bindings.TypeConverter {
converter := bindings.NewTypeConverter()
converter.SetMode(bindings.REST)
return converter
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/nsx/services/ippool/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ package ippool
import (
"testing"

"github.com/vmware/vsphere-automation-sdk-go/runtime/bindings"
"github.com/vmware/vsphere-automation-sdk-go/runtime/data"
"github.com/vmware/vsphere-automation-sdk-go/services/nsxt/model"

"github.com/vmware-tanzu/nsx-operator/pkg/nsx/services/common"
)

func TestIPPoolService_WrapHierarchyIPPool(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
iapbs := []*model.IpAddressPoolBlockSubnet{
&model.IpAddressPoolBlockSubnet{
Expand Down
4 changes: 0 additions & 4 deletions pkg/nsx/services/securitypolicy/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func fakeService() *SecurityPolicyService {

func TestSecurityPolicyService_wrapSecurityPolicy(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
mId, mTag, mScope := "11111", "11111", "nsx-op/security_policy_cr_uid"
markDelete := true
Expand Down Expand Up @@ -88,7 +87,6 @@ func TestSecurityPolicyService_wrapSecurityPolicy(t *testing.T) {

func TestSecurityPolicyService_wrapGroups(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
mId, mTag, mScope := "11111", "11111", "nsx-op/security_policy_cr_uid"
markDelete := true
Expand Down Expand Up @@ -125,7 +123,6 @@ func TestSecurityPolicyService_wrapGroups(t *testing.T) {

func TestSecurityPolicyService_wrapRules(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
mId, mTag, mScope := "11111", "11111", "nsx-op/security_policy_cr_uid"
markDelete := true
Expand Down Expand Up @@ -162,7 +159,6 @@ func TestSecurityPolicyService_wrapRules(t *testing.T) {

func TestSecurityPolicyService_wrapResourceReference(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
type args struct {
children []*data.StructValue
Expand Down
1 change: 0 additions & 1 deletion pkg/nsx/services/subnet/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func fakeService() *SubnetService {

func TestSubnetService_wrapSubnet(t *testing.T) {
Converter := bindings.NewTypeConverter()
Converter.SetMode(bindings.REST)
service := fakeService()
mId, mTag, mScope := "11111", "11111", "nsx-op/subnet_cr_uid"
markDelete := true
Expand Down
7 changes: 5 additions & 2 deletions pkg/nsx/services/subnetport/subnetport.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func (service *SubnetPortService) CreateOrUpdateSubnetPort(obj interface{}, nsxS
uid = string(o.UID)
}
log.Info("creating or updating subnetport", "nsxSubnetPort.Id", uid, "nsxSubnetPath", nsxSubnetPath)
nsxSubnetPort, err := service.buildSubnetPort(obj, nsxSubnetPath, contextID, tags)
//nsxSubnetPort, err := service.buildSubnetPort(obj, nsxSubnetPath, contextID, tags)
nsxSubnetPort := &model.VpcSubnetPort{}
var err error
if err != nil {
log.Error(err, "failed to build NSX subnet port", "nsxSubnetPort.Id", uid, "nsxSubnetPath", nsxSubnetPath, "contextID", contextID)
return nil, err
Expand All @@ -93,7 +95,8 @@ func (service *SubnetPortService) CreateOrUpdateSubnetPort(obj interface{}, nsxS
return nil, err
}
existingSubnetPort := service.SubnetPortStore.GetByKey(*nsxSubnetPort.Id)
isChanged := servicecommon.CompareResource(SubnetPortToComparable(existingSubnetPort), SubnetPortToComparable(nsxSubnetPort))
//isChanged := servicecommon.CompareResource(SubnetPortToComparable(existingSubnetPort), SubnetPortToComparable(nsxSubnetPort))
isChanged := false
if !isChanged {
log.Info("NSX subnet port not changed, skipping the update", "nsxSubnetPort.Id", nsxSubnetPort.Id, "nsxSubnetPath", nsxSubnetPath)
// We don't need to update it but still need to check realized state.
Expand Down
3 changes: 2 additions & 1 deletion pkg/nsx/services/vpc/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ func (s *VPCService) CreatOrUpdatePrivateIPBlock(obj *v1alpha1.VPC, nc VPCNetwor
log.Error(ipblockError, message)
return nil, ipblockError
}
createdBlock, err := s.NSXClient.IPBlockClient.Get(nc.Org, nc.NsxtProject, *block.Id)
ignoreIpblockUsage := true
createdBlock, err := s.NSXClient.IPBlockClient.Get(nc.Org, nc.NsxtProject, *block.Id, &ignoreIpblockUsage)
if err != nil {
// created by can not get, ignore this error
log.Info("failed to read ip blocks from NSX", "Project", nc.NsxtProject, "IPBlock", block.Id)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/nsx_ippool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ func TestIPPoolSubnetsNil(t *testing.T) {
// Check nsx-t resource not existing
err = testData.waitForResourceExistOrNot(ns, common.ResourceTypeIPPool, name, false)
assert_nil(t, err)
}
}

0 comments on commit c2ae596

Please sign in to comment.