From b30f31633efd4c20d164c08c32b701c907cf3712 Mon Sep 17 00:00:00 2001 From: MartinForReal Date: Thu, 27 Oct 2022 09:59:57 +0000 Subject: [PATCH] bump azure compute version to 2022-03-01 Signed-off-by: MartinForReal --- README.md | 2 +- cache_test.go | 12 ++++++------ clients.go | 2 +- data_test.go | 6 +++--- fakes_test.go | 6 +++--- go.mod | 9 ++++----- go.sum | 18 ++++++++---------- interface.go | 2 +- sku.go | 12 ++++++------ sku_test.go | 4 ++-- wrap.go | 2 +- 11 files changed, 36 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 27b5f58..9a665dc 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ import ( "fmt" "github.com/Azure/go-autorest/autorest/azure/auth" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/Azure/skewer" ) diff --git a/cache_test.go b/cache_test.go index 3102bbd..005bb28 100644 --- a/cache_test.go +++ b/cache_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/Azure/go-autorest/autorest/to" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -176,7 +176,7 @@ func Test_Map(t *testing.T) { }) } -func Test_Cache_Get(t *testing.T) { // nolint:funlen +func Test_Cache_Get(t *testing.T) { //nolint:funlen cases := map[string]struct { sku string resourceType string @@ -367,7 +367,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.ResourceSkuRestrictionsTypeLocation, + Type: compute.Location, Values: &[]string{"baz"}, }, }, @@ -391,7 +391,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.ResourceSkuRestrictionsTypeZone, + Type: compute.Zone, Values: &[]string{"baz"}, RestrictionInfo: &compute.ResourceSkuRestrictionInfo{ Zones: &[]string{"1"}, @@ -517,7 +517,7 @@ func Test_Cache_GetVirtualMachineAvailabilityZonesForSize(t *testing.T) { //noli }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.ResourceSkuRestrictionsTypeLocation, + Type: compute.Location, Values: &[]string{"baz"}, }, }, @@ -541,7 +541,7 @@ func Test_Cache_GetVirtualMachineAvailabilityZonesForSize(t *testing.T) { //noli }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.ResourceSkuRestrictionsTypeZone, + Type: compute.Zone, Values: &[]string{"baz"}, RestrictionInfo: &compute.ResourceSkuRestrictionInfo{ Zones: &[]string{"1"}, diff --git a/clients.go b/clients.go index 34fc4b1..3032bea 100644 --- a/clients.go +++ b/clients.go @@ -3,7 +3,7 @@ package skewer import ( "context" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/pkg/errors" ) diff --git a/data_test.go b/data_test.go index 3511ddf..ae813ae 100644 --- a/data_test.go +++ b/data_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" ) @@ -16,7 +16,7 @@ var ( expectedAvailabilityZones = []string{"1", "2", "3"} ) -// nolint:gocyclo,funlen +//nolint:gocyclo,funlen func Test_Data(t *testing.T) { dataWrapper, err := newDataWrapper("./testdata/eastus.json") if err != nil { @@ -202,7 +202,7 @@ func Test_Data(t *testing.T) { } if quantity, err := sku.GetCapabilityIntegerQuantity("PremiumIO"); quantity != -1 || !errors.As(err, &errCapabilityValueNil) || - err.Error() != "PremiumIOCapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'" { // nolint:lll + err.Error() != "PremiumIOCapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'" { //nolint:lll t.Errorf("expected standard_d2_v2 to fail parsing value for boolean premiumIO as int, got value '%d' and error '%s'", quantity, err) } if sku.HasZonalCapability(UltraSSDAvailable) { diff --git a/fakes_test.go b/fakes_test.go index 1986523..2ed970b 100644 --- a/fakes_test.go +++ b/fakes_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "os" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck ) // dataWrapper is a convenience wrapper for deserializing json testdata @@ -59,7 +59,7 @@ func (f *fakeResourceClient) ListComplete(ctx context.Context, filter, includeEx return f.res, nil } -// nolint:deadcode,unused +//nolint:deadcode,unused func newFailingFakeResourceClient(reterr error) *fakeResourceClient { return &fakeResourceClient{ res: compute.ResourceSkusResultIterator{}, @@ -99,7 +99,7 @@ func (f *fakeResourceProviderClient) List(ctx context.Context, filter, includeEx return f.res, nil } -// nolint:deadcode,unused +//nolint:deadcode,unused func newFailingFakeResourceProviderClient(reterr error) *fakeResourceProviderClient { return &fakeResourceProviderClient{ res: compute.ResourceSkusResultPage{}, diff --git a/go.mod b/go.mod index 6bec576..dfabb13 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/Azure/skewer go 1.17 require ( - github.com/Azure/azure-sdk-for-go v66.0.0+incompatible - github.com/Azure/go-autorest/autorest v0.11.26 // indirect + github.com/Azure/azure-sdk-for-go v67.0.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.28 // indirect github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/google/go-cmp v0.5.1 + github.com/google/go-cmp v0.5.9 github.com/pkg/errors v0.9.1 ) @@ -18,6 +18,5 @@ require ( github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/golang-jwt/jwt/v4 v4.2.0 // indirect - golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect - golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect ) diff --git a/go.sum b/go.sum index c2713f1..cc1b646 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ -github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE= -github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v67.0.0+incompatible h1:SVBwznSETB0Sipd0uyGJr7khLhJOFRUEUb+0JgkCvDo= +github.com/Azure/azure-sdk-for-go v67.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.26 h1:W/MzvoAiFfL5h4nq81wm7axvITgbnOoifXXGkFrgF1g= -github.com/Azure/go-autorest/autorest v0.11.26/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= +github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= +github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA= github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= @@ -24,8 +24,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -34,8 +34,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -45,5 +45,3 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/interface.go b/interface.go index c508af4..cac174e 100644 --- a/interface.go +++ b/interface.go @@ -3,7 +3,7 @@ package skewer import ( "context" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck ) // ResourceClient is the required Azure client interface used to populate skewer's data. diff --git a/sku.go b/sku.go index 475ebea..a33c623 100644 --- a/sku.go +++ b/sku.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/pkg/errors" ) @@ -307,7 +307,7 @@ func (s *SKU) IsAvailable(location string) bool { if s.Restrictions != nil { for _, restriction := range *s.Restrictions { // Can't deploy to any zones in this location. We're done. - if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { + if restriction.Type == compute.Location { return false } } @@ -331,7 +331,7 @@ func (s *SKU) IsRestricted(location string) bool { } for _, candidate := range *restriction.Values { // Can't deploy in this location. We're done. - if locationEquals(candidate, location) && restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { + if locationEquals(candidate, location) && restriction.Type == compute.Location { return true } } @@ -419,7 +419,7 @@ func (s *SKU) HasLocationRestriction(location string) bool { } for _, restriction := range *s.Restrictions { - if restriction.Type != compute.ResourceSkuRestrictionsTypeLocation { + if restriction.Type != compute.Location { continue } if restriction.Values == nil { @@ -436,7 +436,7 @@ func (s *SKU) HasLocationRestriction(location string) bool { } // AvailabilityZones returns the list of Availability Zones which have this resource SKU available and unrestricted. -func (s *SKU) AvailabilityZones(location string) map[string]bool { // nolint:gocyclo +func (s *SKU) AvailabilityZones(location string) map[string]bool { //nolint:gocyclo if s.LocationInfo == nil { return nil } @@ -463,7 +463,7 @@ func (s *SKU) AvailabilityZones(location string) map[string]bool { // nolint:goc if restriction.Values != nil { for _, candidate := range *restriction.Values { if locationEquals(candidate, location) { - if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { + if restriction.Type == compute.Location { // Can't deploy in this location. We're done. return nil } diff --git a/sku_test.go b/sku_test.go index b249798..2b49099 100644 --- a/sku_test.go +++ b/sku_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/Azure/go-autorest/autorest/to" "github.com/google/go-cmp/cmp" ) @@ -38,7 +38,7 @@ func Test_SKU_GetCapabilityQuantity(t *testing.T) { }, }, capability: "", - err: "CapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'", // nolint:lll + err: "CapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'", //nolint:lll }, "foo capability should return successfully with integer": { sku: compute.ResourceSku{ diff --git a/wrap.go b/wrap.go index 606fbcf..37cad37 100644 --- a/wrap.go +++ b/wrap.go @@ -1,6 +1,6 @@ package skewer -import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck +import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck // Wrap takes an array of compute resource skus and wraps them into an // array of our richer type.