Skip to content

Commit

Permalink
[e2e] tests can run in any zone safely
Browse files Browse the repository at this point in the history
  • Loading branch information
Mia-Cross committed Feb 12, 2024
1 parent 62befce commit 1326264
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
args = appendIfUnset(args, "--master-size", "c2-16vcpu-32gb")
args = appendIfUnset(args, "--node-size", "c2-16vcpu-32gb")
case "scaleway":
args = appendIfUnset(args, "--master-size", "DEV1-M")
args = appendIfUnset(args, "--node-size", "DEV1-M")
args = appendIfUnset(args, "--master-size", "PRO2-S")
args = appendIfUnset(args, "--node-size", "PRO2-S")
}

args = appendIfUnset(args, "--master-volume-size", "48")
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/kubetest2-kops/scaleway/zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/scaleway/scaleway-sdk-go/api/instance/v1"
"github.com/scaleway/scaleway-sdk-go/api/lb/v1"
"github.com/scaleway/scaleway-sdk-go/api/vpcgw/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
)

Expand All @@ -45,10 +46,13 @@ func RandomZones(count int) ([]string, error) {
instanceAPIZones := instanceAPI.Zones()
lbAPI := &lb.ZonedAPI{}
lbAPIZones := lbAPI.Zones()
vpcgwAPI := vpcgw.API{}
vpcgwAPIZones := vpcgwAPI.Zones()

allAvailableZones := []scw.Zone(nil)
for _, zone := range append(instanceAPIZones, lbAPIZones...) {
if !zoneIsInZones(zone, allAvailableZones) && zoneIsInZones(zone, instanceAPIZones) && zoneIsInZones(zone, lbAPIZones) {
if !zoneIsInZones(zone, allAvailableZones) && zoneIsInZones(zone, instanceAPIZones) &&
zoneIsInZones(zone, lbAPIZones) && zoneIsInZones(zone, vpcgwAPIZones) {
allAvailableZones = append(allAvailableZones, zone)
}
}
Expand Down

0 comments on commit 1326264

Please sign in to comment.