Skip to content

Commit 7b622b6

Browse files
authored
Update to use the 2021-12-01 compute API version (#13)
1 parent 4fdc922 commit 7b622b6

File tree

11 files changed

+49
-46
lines changed

11 files changed

+49
-46
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"fmt"
1717

1818
"github.com/Azure/go-autorest/autorest/azure/auth"
19-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
19+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
2020

2121
"github.com/Azure/skewer"
2222
)

cache_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strings"
66
"testing"
77

8-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
99
"github.com/Azure/go-autorest/autorest/to"
1010
"github.com/google/go-cmp/cmp"
1111
"github.com/google/go-cmp/cmp/cmpopts"
@@ -367,7 +367,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen
367367
},
368368
Restrictions: &[]compute.ResourceSkuRestrictions{
369369
{
370-
Type: compute.Location,
370+
Type: compute.ResourceSkuRestrictionsTypeLocation,
371371
Values: &[]string{"baz"},
372372
},
373373
},
@@ -391,7 +391,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen
391391
},
392392
Restrictions: &[]compute.ResourceSkuRestrictions{
393393
{
394-
Type: compute.Zone,
394+
Type: compute.ResourceSkuRestrictionsTypeZone,
395395
Values: &[]string{"baz"},
396396
RestrictionInfo: &compute.ResourceSkuRestrictionInfo{
397397
Zones: &[]string{"1"},
@@ -517,7 +517,7 @@ func Test_Cache_GetVirtualMachineAvailabilityZonesForSize(t *testing.T) { //noli
517517
},
518518
Restrictions: &[]compute.ResourceSkuRestrictions{
519519
{
520-
Type: compute.Location,
520+
Type: compute.ResourceSkuRestrictionsTypeLocation,
521521
Values: &[]string{"baz"},
522522
},
523523
},
@@ -541,7 +541,7 @@ func Test_Cache_GetVirtualMachineAvailabilityZonesForSize(t *testing.T) { //noli
541541
},
542542
Restrictions: &[]compute.ResourceSkuRestrictions{
543543
{
544-
Type: compute.Zone,
544+
Type: compute.ResourceSkuRestrictionsTypeZone,
545545
Values: &[]string{"baz"},
546546
RestrictionInfo: &compute.ResourceSkuRestrictionInfo{
547547
Zones: &[]string{"1"},

clients.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package skewer
33
import (
44
"context"
55

6-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
6+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
77
"github.com/pkg/errors"
88
)
99

data_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77
"testing"
88

9-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
9+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
1010
"github.com/google/go-cmp/cmp"
1111
"github.com/google/go-cmp/cmp/cmpopts"
1212
)

fakes_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/json"
66
"io/ioutil"
77

8-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
99
)
1010

1111
// dataWrapper is a convenience wrapper for deserializing json testdata
@@ -125,7 +125,8 @@ func newSuccessfulFakeResourceProviderClient(skuLists [][]compute.ResourceSku) (
125125
// list to a page of values.
126126
func newFakeResourceSkusResultPage(skuLists [][]compute.ResourceSku) (compute.ResourceSkusResultPage, error) {
127127
pages := newPageList(skuLists)
128-
newPage := compute.NewResourceSkusResultPage(pages.next)
128+
newPage := compute.NewResourceSkusResultPage(compute.ResourceSkusResult{}, pages.next)
129+
129130
if err := newPage.NextWithContext(context.Background()); err != nil {
130131
return compute.ResourceSkusResultPage{}, err
131132
}
@@ -137,7 +138,7 @@ func newFakeResourceSkusResultPage(skuLists [][]compute.ResourceSku) (compute.Re
137138
// list to a page of values.
138139
func newFakeResourceSkusResultIterator(skuLists [][]compute.ResourceSku) (compute.ResourceSkusResultIterator, error) {
139140
pages := newPageList(skuLists)
140-
newPage := compute.NewResourceSkusResultPage(pages.next)
141+
newPage := compute.NewResourceSkusResultPage(compute.ResourceSkusResult{}, pages.next)
141142
if err := newPage.NextWithContext(context.Background()); err != nil {
142143
return compute.ResourceSkusResultIterator{}, err
143144
}

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ module github.com/Azure/skewer
33
go 1.13
44

55
require (
6-
github.com/Azure/azure-sdk-for-go v46.0.0+incompatible
7-
github.com/Azure/go-autorest/autorest v0.11.4 // indirect
8-
github.com/Azure/go-autorest/autorest/adal v0.9.2 // indirect
6+
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible
7+
github.com/Azure/go-autorest/autorest v0.11.26 // indirect
98
github.com/Azure/go-autorest/autorest/to v0.4.0
10-
github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect
119
github.com/google/go-cmp v0.5.1
1210
github.com/pkg/errors v0.9.1
13-
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
1411
)
12+
13+
require github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect

go.sum

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
github.com/Azure/azure-sdk-for-go v46.0.0+incompatible h1:4qlEOCDcDQZTGczYGzbGYCdJfVpZLIs8AEo5+MoXBPw=
2-
github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
1+
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE=
2+
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
33
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
44
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
5-
github.com/Azure/go-autorest/autorest v0.11.4 h1:iWJqGEvip7mjibEqC/srXNdo+4wLEPiwlP/7dZLtoPc=
6-
github.com/Azure/go-autorest/autorest v0.11.4/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw=
7-
github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
8-
github.com/Azure/go-autorest/autorest/adal v0.9.2 h1:Aze/GQeAN1RRbGmnUJvUj+tFGBzFdIg3293/A9rbxC4=
9-
github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE=
5+
github.com/Azure/go-autorest/autorest v0.11.26 h1:W/MzvoAiFfL5h4nq81wm7axvITgbnOoifXXGkFrgF1g=
6+
github.com/Azure/go-autorest/autorest v0.11.26/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U=
7+
github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ=
8+
github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
109
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
1110
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
12-
github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
13-
github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=
1411
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
12+
github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw=
13+
github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU=
1514
github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk=
1615
github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE=
1716
github.com/Azure/go-autorest/autorest/validation v0.3.0 h1:3I9AAI63HfcLtphd9g39ruUwRI+Ca+z/f36KHPFRUss=
1817
github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E=
19-
github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE=
20-
github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
18+
github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
19+
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
2120
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
2221
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
2322
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
2423
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
25-
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
26-
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
24+
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
25+
github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
26+
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
2727
github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
2828
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2929
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
3333
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3434
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
3535
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
36-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
37-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
38-
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
39-
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
40-
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
41-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
42-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
43-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
44-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
36+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
37+
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M=
38+
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
39+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
40+
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
41+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
42+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
43+
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
44+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
45+
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
46+
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
47+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
4548
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
4649
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package skewer
33
import (
44
"context"
55

6-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
6+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
77
)
88

99
// ResourceClient is the required Azure client interface used to populate skewer's data.

sku.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strconv"
66
"strings"
77

8-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
99
"github.com/pkg/errors"
1010
)
1111

@@ -307,7 +307,7 @@ func (s *SKU) IsAvailable(location string) bool {
307307
if s.Restrictions != nil {
308308
for _, restriction := range *s.Restrictions {
309309
// Can't deploy to any zones in this location. We're done.
310-
if restriction.Type == compute.Location {
310+
if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation {
311311
return false
312312
}
313313
}
@@ -331,7 +331,7 @@ func (s *SKU) IsRestricted(location string) bool {
331331
}
332332
for _, candidate := range *restriction.Values {
333333
// Can't deploy in this location. We're done.
334-
if locationEquals(candidate, location) && restriction.Type == compute.Location {
334+
if locationEquals(candidate, location) && restriction.Type == compute.ResourceSkuRestrictionsTypeLocation {
335335
return true
336336
}
337337
}
@@ -419,7 +419,7 @@ func (s *SKU) HasLocationRestriction(location string) bool {
419419
}
420420

421421
for _, restriction := range *s.Restrictions {
422-
if restriction.Type != compute.Location {
422+
if restriction.Type != compute.ResourceSkuRestrictionsTypeLocation {
423423
continue
424424
}
425425
if restriction.Values == nil {
@@ -463,7 +463,7 @@ func (s *SKU) AvailabilityZones(location string) map[string]bool { // nolint:goc
463463
if restriction.Values != nil {
464464
for _, candidate := range *restriction.Values {
465465
if locationEquals(candidate, location) {
466-
if restriction.Type == compute.Location {
466+
if restriction.Type == compute.ResourceSkuRestrictionsTypeLocation {
467467
// Can't deploy in this location. We're done.
468468
return nil
469469
}

sku_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"testing"
66

7-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
7+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute"
88
"github.com/Azure/go-autorest/autorest/to"
99
"github.com/google/go-cmp/cmp"
1010
)

0 commit comments

Comments
 (0)