@@ -3,6 +3,7 @@ package main
3
3
import (
4
4
"fmt"
5
5
"os"
6
+ "strconv"
6
7
"strings"
7
8
"testing"
8
9
"time"
@@ -58,15 +59,28 @@ func (s *SetupTests) CreateCluster(t *testing.T) {
58
59
}
59
60
require .LessOrEqual (t , len (osImages ), SmokeTestNodeCount , "more os images then smoke test node specified" )
60
61
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
+
61
74
pools := []models.NodePool {}
62
75
for i , image := range osImages {
63
76
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 ),
70
84
})
71
85
}
72
86
//we fill up the first pool in case the number of images is smaller then the smoke test node count
0 commit comments