diff --git a/README.md b/README.md index 33064dd..9fd85c0 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "github.com/Azure/skewer" ) diff --git a/cache_test.go b/cache_test.go index 0e36f97..6d9d565 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "github.com/Azure/go-autorest/autorest/to" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -367,7 +367,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.Location, + Type: compute.ResourceSkuRestrictionsTypeLocation, Values: &[]string{"baz"}, }, }, @@ -391,7 +391,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.Zone, + Type: compute.ResourceSkuRestrictionsTypeZone, 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.Location, + Type: compute.ResourceSkuRestrictionsTypeLocation, Values: &[]string{"baz"}, }, }, @@ -541,7 +541,7 @@ func Test_Cache_GetVirtualMachineAvailabilityZonesForSize(t *testing.T) { //noli }, Restrictions: &[]compute.ResourceSkuRestrictions{ { - Type: compute.Zone, + Type: compute.ResourceSkuRestrictionsTypeZone, Values: &[]string{"baz"}, RestrictionInfo: &compute.ResourceSkuRestrictionInfo{ Zones: &[]string{"1"}, diff --git a/clients.go b/clients.go index 8d8538d..cd426dd 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "github.com/pkg/errors" ) diff --git a/data_test.go b/data_test.go index d9bf854..3235315 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" ) diff --git a/fakes_test.go b/fakes_test.go index af0ba4b..4ddb1b5 100644 --- a/fakes_test.go +++ b/fakes_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "io/ioutil" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" ) // dataWrapper is a convenience wrapper for deserializing json testdata @@ -125,7 +125,8 @@ func newSuccessfulFakeResourceProviderClient(skuLists [][]compute.ResourceSku) ( // list to a page of values. func newFakeResourceSkusResultPage(skuLists [][]compute.ResourceSku) (compute.ResourceSkusResultPage, error) { pages := newPageList(skuLists) - newPage := compute.NewResourceSkusResultPage(pages.next) + newPage := compute.NewResourceSkusResultPage(compute.ResourceSkusResult{}, pages.next) + if err := newPage.NextWithContext(context.Background()); err != nil { return compute.ResourceSkusResultPage{}, err } @@ -137,7 +138,7 @@ func newFakeResourceSkusResultPage(skuLists [][]compute.ResourceSku) (compute.Re // list to a page of values. func newFakeResourceSkusResultIterator(skuLists [][]compute.ResourceSku) (compute.ResourceSkusResultIterator, error) { pages := newPageList(skuLists) - newPage := compute.NewResourceSkusResultPage(pages.next) + newPage := compute.NewResourceSkusResultPage(compute.ResourceSkusResult{}, pages.next) if err := newPage.NextWithContext(context.Background()); err != nil { return compute.ResourceSkusResultIterator{}, err } diff --git a/go.mod b/go.mod index 580e894..d1d674f 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,11 @@ module github.com/Azure/skewer go 1.13 require ( - github.com/Azure/azure-sdk-for-go v46.0.0+incompatible - github.com/Azure/go-autorest/autorest v0.11.4 // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.2 // indirect + github.com/Azure/azure-sdk-for-go v66.0.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.26 // indirect github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect github.com/google/go-cmp v0.5.1 github.com/pkg/errors v0.9.1 - golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect ) + +require github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect diff --git a/go.sum b/go.sum index 1449975..c2713f1 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,29 @@ -github.com/Azure/azure-sdk-for-go v46.0.0+incompatible h1:4qlEOCDcDQZTGczYGzbGYCdJfVpZLIs8AEo5+MoXBPw= -github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +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/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.4 h1:iWJqGEvip7mjibEqC/srXNdo+4wLEPiwlP/7dZLtoPc= -github.com/Azure/go-autorest/autorest v0.11.4/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.2 h1:Aze/GQeAN1RRbGmnUJvUj+tFGBzFdIg3293/A9rbxC4= -github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= +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/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= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= +github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= github.com/Azure/go-autorest/autorest/validation v0.3.0 h1:3I9AAI63HfcLtphd9g39ruUwRI+Ca+z/f36KHPFRUss= github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= -github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +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/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -33,14 +33,17 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +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/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= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +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 fd20bc3..05cba21 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" ) // ResourceClient is the required Azure client interface used to populate skewer's data. diff --git a/sku.go b/sku.go index 167c330..7bb7c39 100644 --- a/sku.go +++ b/sku.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "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.Location { + if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { 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.Location { + if locationEquals(candidate, location) && restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { return true } } @@ -419,7 +419,7 @@ func (s *SKU) HasLocationRestriction(location string) bool { } for _, restriction := range *s.Restrictions { - if restriction.Type != compute.Location { + if restriction.Type != compute.ResourceSkuRestrictionsTypeLocation { continue } if restriction.Values == 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.Location { + if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation { // Can't deploy in this location. We're done. return nil } diff --git a/sku_test.go b/sku_test.go index edb2df4..a32cdcf 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/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" "github.com/Azure/go-autorest/autorest/to" "github.com/google/go-cmp/cmp" ) diff --git a/wrap.go b/wrap.go index a9c5eee..adbcc66 100644 --- a/wrap.go +++ b/wrap.go @@ -1,6 +1,6 @@ package skewer -import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" +import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" // Wrap takes an array of compute resource skus and wraps them into an // array of our richer type.