Skip to content

Commit 6bb25ca

Browse files
committed
Allow to specific flavor and custom root disk in e2e test
Signed-off-by: Fabian Ruff <[email protected]>
1 parent 2688349 commit 6bb25ca

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

test/e2e/setup_test.go

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"os"
6+
"strconv"
67
"strings"
78
"testing"
89
"time"
@@ -58,15 +59,28 @@ func (s *SetupTests) CreateCluster(t *testing.T) {
5859
}
5960
require.LessOrEqual(t, len(osImages), SmokeTestNodeCount, "more os images then smoke test node specified")
6061

62+
flavor := "c_c2_m2"
63+
if os.Getenv("KLUSTER_FLAVOR") != "" {
64+
flavor = os.Getenv("KLUSTER_FLAVOR")
65+
}
66+
customerRootDiskSize := 0 // no custom root disk size by default
67+
if os.Getenv("KLUSTER_CUSTOM_ROOT_DISK_SIZE") != "" {
68+
var err error
69+
customerRootDiskSize, err = strconv.Atoi(os.Getenv("KLUSTER_CUSTOM_ROOT_DISK_SIZE"))
70+
require.NoError(t, err, "KLUSTER_CUSTOM_ROOT_DISK_SIZE must be a valid integer")
71+
require.Greater(t, customerRootDiskSize, 0, "KLUSTER_CUSTOM_ROOT_DISK_SIZE must be greater than 0")
72+
}
73+
6174
pools := []models.NodePool{}
6275
for i, image := range osImages {
6376
pools = append(pools, models.NodePool{
64-
Name: fmt.Sprintf("pool%d", i+1),
65-
Flavor: "c_c2_m2",
66-
Size: 1,
67-
AvailabilityZone: os.Getenv("NODEPOOL_AVZ"),
68-
Image: image,
69-
Labels: []string{"image=" + image},
77+
Name: fmt.Sprintf("pool%d", i+1),
78+
Flavor: flavor,
79+
Size: 1,
80+
AvailabilityZone: os.Getenv("NODEPOOL_AVZ"),
81+
Image: image,
82+
Labels: []string{"image=" + image},
83+
CustomRootDiskSize: int64(customerRootDiskSize),
7084
})
7185
}
7286
//we fill up the first pool in case the number of images is smaller then the smoke test node count

0 commit comments

Comments
 (0)