Skip to content

Commit b30f316

Browse files
committed
bump azure compute version to 2022-03-01
Signed-off-by: MartinForReal <fanshangxiang@gmail.com>
1 parent f2a784d commit b30f316

File tree

11 files changed

+36
-39
lines changed

11 files changed

+36
-39
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/2021-12-01/compute" //nolint:staticcheck
19+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
2020

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

cache_test.go

Lines changed: 6 additions & 6 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/2021-12-01/compute" //nolint:staticcheck
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
99
"github.com/Azure/go-autorest/autorest/to"
1010
"github.com/google/go-cmp/cmp"
1111
"github.com/google/go-cmp/cmp/cmpopts"
@@ -176,7 +176,7 @@ func Test_Map(t *testing.T) {
176176
})
177177
}
178178

179-
func Test_Cache_Get(t *testing.T) { // nolint:funlen
179+
func Test_Cache_Get(t *testing.T) { //nolint:funlen
180180
cases := map[string]struct {
181181
sku string
182182
resourceType string
@@ -367,7 +367,7 @@ func Test_Cache_GetAvailabilityZones(t *testing.T) { //nolint:funlen
367367
},
368368
Restrictions: &[]compute.ResourceSkuRestrictions{
369369
{
370-
Type: compute.ResourceSkuRestrictionsTypeLocation,
370+
Type: compute.Location,
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.ResourceSkuRestrictionsTypeZone,
394+
Type: compute.Zone,
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.ResourceSkuRestrictionsTypeLocation,
520+
Type: compute.Location,
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.ResourceSkuRestrictionsTypeZone,
544+
Type: compute.Zone,
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/2021-12-01/compute" //nolint:staticcheck
6+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
77
"github.com/pkg/errors"
88
)
99

data_test.go

Lines changed: 3 additions & 3 deletions
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/2021-12-01/compute" //nolint:staticcheck
9+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
1010
"github.com/google/go-cmp/cmp"
1111
"github.com/google/go-cmp/cmp/cmpopts"
1212
)
@@ -16,7 +16,7 @@ var (
1616
expectedAvailabilityZones = []string{"1", "2", "3"}
1717
)
1818

19-
// nolint:gocyclo,funlen
19+
//nolint:gocyclo,funlen
2020
func Test_Data(t *testing.T) {
2121
dataWrapper, err := newDataWrapper("./testdata/eastus.json")
2222
if err != nil {
@@ -202,7 +202,7 @@ func Test_Data(t *testing.T) {
202202
}
203203
if quantity, err := sku.GetCapabilityIntegerQuantity("PremiumIO"); quantity != -1 ||
204204
!errors.As(err, &errCapabilityValueNil) ||
205-
err.Error() != "PremiumIOCapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'" { // nolint:lll
205+
err.Error() != "PremiumIOCapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'" { //nolint:lll
206206
t.Errorf("expected standard_d2_v2 to fail parsing value for boolean premiumIO as int, got value '%d' and error '%s'", quantity, err)
207207
}
208208
if sku.HasZonalCapability(UltraSSDAvailable) {

fakes_test.go

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

8-
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-12-01/compute" //nolint:staticcheck
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
99
)
1010

1111
// dataWrapper is a convenience wrapper for deserializing json testdata
@@ -59,7 +59,7 @@ func (f *fakeResourceClient) ListComplete(ctx context.Context, filter, includeEx
5959
return f.res, nil
6060
}
6161

62-
// nolint:deadcode,unused
62+
//nolint:deadcode,unused
6363
func newFailingFakeResourceClient(reterr error) *fakeResourceClient {
6464
return &fakeResourceClient{
6565
res: compute.ResourceSkusResultIterator{},
@@ -99,7 +99,7 @@ func (f *fakeResourceProviderClient) List(ctx context.Context, filter, includeEx
9999
return f.res, nil
100100
}
101101

102-
// nolint:deadcode,unused
102+
//nolint:deadcode,unused
103103
func newFailingFakeResourceProviderClient(reterr error) *fakeResourceProviderClient {
104104
return &fakeResourceProviderClient{
105105
res: compute.ResourceSkusResultPage{},

go.mod

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

55
require (
6-
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible
7-
github.com/Azure/go-autorest/autorest v0.11.26 // indirect
6+
github.com/Azure/azure-sdk-for-go v67.0.0+incompatible
7+
github.com/Azure/go-autorest/autorest v0.11.28 // indirect
88
github.com/Azure/go-autorest/autorest/to v0.4.0
9-
github.com/google/go-cmp v0.5.1
9+
github.com/google/go-cmp v0.5.9
1010
github.com/pkg/errors v0.9.1
1111
)
1212

@@ -18,6 +18,5 @@ require (
1818
github.com/Azure/go-autorest/logger v0.2.1 // indirect
1919
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
2020
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
21-
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
22-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
21+
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
2322
)

go.sum

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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=
1+
github.com/Azure/azure-sdk-for-go v67.0.0+incompatible h1:SVBwznSETB0Sipd0uyGJr7khLhJOFRUEUb+0JgkCvDo=
2+
github.com/Azure/azure-sdk-for-go v67.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.26 h1:W/MzvoAiFfL5h4nq81wm7axvITgbnOoifXXGkFrgF1g=
6-
github.com/Azure/go-autorest/autorest v0.11.26/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U=
5+
github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM=
6+
github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA=
77
github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ=
88
github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
99
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
2424
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
2525
github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
2626
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
27-
github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
28-
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
27+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
28+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2929
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
3030
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
3131
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+
3434
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
3535
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
3636
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=
37+
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c=
38+
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
3939
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
4040
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
4141
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
4545
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
4646
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
4747
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
48-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
49-
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/2021-12-01/compute" //nolint:staticcheck
6+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
77
)
88

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

sku.go

Lines changed: 6 additions & 6 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/2021-12-01/compute" //nolint:staticcheck
8+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
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.ResourceSkuRestrictionsTypeLocation {
310+
if restriction.Type == compute.Location {
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.ResourceSkuRestrictionsTypeLocation {
334+
if locationEquals(candidate, location) && restriction.Type == compute.Location {
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.ResourceSkuRestrictionsTypeLocation {
422+
if restriction.Type != compute.Location {
423423
continue
424424
}
425425
if restriction.Values == nil {
@@ -436,7 +436,7 @@ func (s *SKU) HasLocationRestriction(location string) bool {
436436
}
437437

438438
// AvailabilityZones returns the list of Availability Zones which have this resource SKU available and unrestricted.
439-
func (s *SKU) AvailabilityZones(location string) map[string]bool { // nolint:gocyclo
439+
func (s *SKU) AvailabilityZones(location string) map[string]bool { //nolint:gocyclo
440440
if s.LocationInfo == nil {
441441
return nil
442442
}
@@ -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.ResourceSkuRestrictionsTypeLocation {
466+
if restriction.Type == compute.Location {
467467
// Can't deploy in this location. We're done.
468468
return nil
469469
}

sku_test.go

Lines changed: 2 additions & 2 deletions
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/2021-12-01/compute" //nolint:staticcheck
7+
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck
88
"github.com/Azure/go-autorest/autorest/to"
99
"github.com/google/go-cmp/cmp"
1010
)
@@ -38,7 +38,7 @@ func Test_SKU_GetCapabilityQuantity(t *testing.T) {
3838
},
3939
},
4040
capability: "",
41-
err: "CapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'", // nolint:lll
41+
err: "CapabilityValueParse: failed to parse string 'False' as int64, error: 'strconv.ParseInt: parsing \"False\": invalid syntax'", //nolint:lll
4242
},
4343
"foo capability should return successfully with integer": {
4444
sku: compute.ResourceSku{

0 commit comments

Comments
 (0)