Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for pl-waw-2 #1411

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
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",
},
}

Expand Down
5 changes: 4 additions & 1 deletion scw/locality.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const (
ZoneNlAms2 = Zone("nl-ams-2")
// ZonePlWaw1 represents the pl-waw-1 zone
ZonePlWaw1 = Zone("pl-waw-1")
// ZonePlWaw2 represents the pl-waw-2 zone
ZonePlWaw2 = Zone("pl-waw-2")
)

var (
Expand All @@ -40,6 +42,7 @@ var (
ZoneNlAms1,
ZoneNlAms2,
ZonePlWaw1,
ZonePlWaw2,
}
)

Expand Down Expand Up @@ -108,7 +111,7 @@ func (region Region) GetZones() []Zone {
case RegionNlAms:
return []Zone{ZoneNlAms1, ZoneNlAms2}
case RegionPlWaw:
return []Zone{ZonePlWaw1}
return []Zone{ZonePlWaw1, ZonePlWaw2}
default:
return []Zone{}
}
Expand Down
10 changes: 7 additions & 3 deletions scw/locality_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func TestParseZone(t *testing.T) {
input: "pl-waw-1",
expected: ZonePlWaw1,
},
{
input: "pl-waw-2",
expected: ZonePlWaw2,
},
{
input: "nl-ams-2",
expected: ZoneNlAms2,
Expand All @@ -41,17 +45,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"),
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"),
},
{
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"),
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"),
},
{
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"),
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"),
},
}

Expand Down