Skip to content

Commit

Permalink
migrate vmss/vmas/vm/lb/nic/pip client to track2 one
Browse files Browse the repository at this point in the history
Signed-off-by: Fan Shang Xiang <[email protected]>
  • Loading branch information
MartinForReal committed Dec 15, 2024
1 parent f3273f1 commit 487be03
Show file tree
Hide file tree
Showing 329 changed files with 8,770 additions and 148,463 deletions.
195 changes: 0 additions & 195 deletions LICENSES/vendor/github.com/Azure/go-autorest/autorest/mocks/LICENSE

This file was deleted.

7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/adal v0.9.24
github.com/Azure/go-autorest/autorest/mocks v0.4.2
github.com/Azure/go-autorest/tracing v0.6.0
github.com/evanphx/json-patch v5.9.0+incompatible
github.com/fsnotify/fsnotify v1.8.0
github.com/go-logr/logr v1.4.2
github.com/google/uuid v1.6.0
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.0
github.com/prometheus/client_golang v1.20.5
github.com/samber/lo v1.47.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.10.0
Expand Down Expand Up @@ -71,10 +69,12 @@ require (
github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.24 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
Expand Down Expand Up @@ -124,7 +124,6 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ github.com/redis/go-redis/v9 v9.6.1/go.mod h1:0C0c6ycQsdpVNQpxb1njEQIqkx5UcsM8FJ
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
Expand Down
15 changes: 7 additions & 8 deletions internal/testutil/fixture/azure_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,27 @@ limitations under the License.
package fixture

import (
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
"k8s.io/utils/ptr"
)

func (f *AzureFixture) LoadBalancer() *AzureLoadBalancerFixture {
return &AzureLoadBalancerFixture{
lb: &network.LoadBalancer{
Name: ptr.To("lb"),
LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
lb: &armnetwork.LoadBalancer{
Name: ptr.To("lb"),
Properties: &armnetwork.LoadBalancerPropertiesFormat{
// TODO
},
},
}
}

type AzureLoadBalancerFixture struct {
lb *network.LoadBalancer
lb *armnetwork.LoadBalancer
}

func (f *AzureLoadBalancerFixture) Build() network.LoadBalancer {
return *f.lb
func (f *AzureLoadBalancerFixture) Build() *armnetwork.LoadBalancer {
return f.lb
}

func (f *AzureLoadBalancerFixture) IPv4Addresses() []string {
Expand Down
19 changes: 9 additions & 10 deletions internal/testutil/fixture/azure_publicip.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ package fixture
import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"

"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v6"
"k8s.io/utils/ptr"
)

Expand All @@ -31,20 +30,20 @@ func (f *AzureFixture) PublicIPAddress(name string) *AzurePublicIPAddressFixture
)

return &AzurePublicIPAddressFixture{
pip: &network.PublicIPAddress{
ID: ptr.To(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", SubscriptionID, ResourceGroup, name)),
Name: ptr.To(name),
Tags: make(map[string]*string),
PublicIPAddressPropertiesFormat: &network.PublicIPAddressPropertiesFormat{},
pip: &armnetwork.PublicIPAddress{
ID: ptr.To(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", SubscriptionID, ResourceGroup, name)),
Name: ptr.To(name),
Tags: make(map[string]*string),
Properties: &armnetwork.PublicIPAddressPropertiesFormat{},
},
}
}

type AzurePublicIPAddressFixture struct {
pip *network.PublicIPAddress
pip *armnetwork.PublicIPAddress
}

func (f *AzurePublicIPAddressFixture) Build() network.PublicIPAddress {
func (f *AzurePublicIPAddressFixture) Build() armnetwork.PublicIPAddress {
return *f.pip
}

Expand All @@ -54,6 +53,6 @@ func (f *AzurePublicIPAddressFixture) WithTag(key, value string) *AzurePublicIPA
}

func (f *AzurePublicIPAddressFixture) WithAddress(address string) *AzurePublicIPAddressFixture {
f.pip.PublicIPAddressPropertiesFormat.IPAddress = ptr.To(address)
f.pip.Properties.IPAddress = ptr.To(address)
return f
}
Loading

0 comments on commit 487be03

Please sign in to comment.