Skip to content

Commit

Permalink
feat: add support for nl-ams-3 (#1572)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Mar 6, 2023
1 parent 4d68c6d commit 6494c5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scw/client_option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestClientOptions(t *testing.T) {
s.token = auth.NewToken(testAccessKey, testSecretKey)
s.defaultZone = &v
},
errStr: "scaleway-sdk-go: invalid default zone format 'invalid', available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, pl-waw-1, pl-waw-2",
errStr: "scaleway-sdk-go: invalid default zone format 'invalid', available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2",
},
}

Expand Down
5 changes: 4 additions & 1 deletion scw/locality.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const (
ZoneNlAms1 = Zone("nl-ams-1")
// ZoneNlAms2 represents the nl-ams-2 zone
ZoneNlAms2 = Zone("nl-ams-2")
// ZoneNlAms3 represents the nl-ams-3 zone
ZoneNlAms3 = Zone("nl-ams-3")
// ZonePlWaw1 represents the pl-waw-1 zone
ZonePlWaw1 = Zone("pl-waw-1")
// ZonePlWaw2 represents the pl-waw-2 zone
Expand All @@ -41,6 +43,7 @@ var (
ZoneFrPar3,
ZoneNlAms1,
ZoneNlAms2,
ZoneNlAms3,
ZonePlWaw1,
ZonePlWaw2,
}
Expand Down Expand Up @@ -109,7 +112,7 @@ func (region Region) GetZones() []Zone {
case RegionFrPar:
return []Zone{ZoneFrPar1, ZoneFrPar2, ZoneFrPar3}
case RegionNlAms:
return []Zone{ZoneNlAms1, ZoneNlAms2}
return []Zone{ZoneNlAms1, ZoneNlAms2, ZoneNlAms3}
case RegionPlWaw:
return []Zone{ZonePlWaw1, ZonePlWaw2}
default:
Expand Down
10 changes: 7 additions & 3 deletions scw/locality_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func TestParseZone(t *testing.T) {
input: "nl-ams-2",
expected: ZoneNlAms2,
},
{
input: "nl-ams-3",
expected: ZoneNlAms3,
},
{
input: "par1",
expected: ZoneFrPar1,
Expand All @@ -45,17 +49,17 @@ func TestParseZone(t *testing.T) {
{
input: "fr-par",
expected: "",
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, pl-waw-1, pl-waw-2"),
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2"),
},
{
input: "fr-par-n",
expected: "",
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, pl-waw-1, pl-waw-2"),
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2"),
},
{
input: "fr-par-0",
expected: "",
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, pl-waw-1, pl-waw-2"),
err: errors.New("bad zone format, available zones are: fr-par-1, fr-par-2, fr-par-3, nl-ams-1, nl-ams-2, nl-ams-3, pl-waw-1, pl-waw-2"),
},
}

Expand Down

0 comments on commit 6494c5a

Please sign in to comment.