@@ -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
+ customRootDiskSize := 0 // no custom root disk size by default
67
+ if os .Getenv ("KLUSTER_CUSTOM_ROOT_DISK_SIZE" ) != "" {
68
+ var err error
69
+ customRootDiskSize , 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 , customRootDiskSize , 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 (customRootDiskSize ),
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
@@ -76,7 +90,7 @@ func (s *SetupTests) CreateCluster(t *testing.T) {
76
90
Name : s .KlusterName ,
77
91
Spec : models.KlusterSpec {
78
92
Version : version ,
79
- SSHPublicKey : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCXIxVEUgtUVkvk2VM1hmIb8MxvxsmvYoiq9OBy3J8akTGNybqKsA2uhcwxSJX5Cn3si8kfMfka9EWiJT+e1ybvtsGILO5XRZPxyhYzexwb3TcALwc3LuzpF3Z/Dg2jYTRELTGhYmyca3mxzTlCjNXvYayLNedjJ8fIBzoCuSXNqDRToHru7h0Glz+wtuE74mNkOiXSvhtuJtJs7VCNVjobFQNfC1aeDsri2bPRHJJZJ0QF4LLYSayMEz3lVwIDyAviQR2Aa97WfuXiofiAemfGqiH47Kq6b8X7j3bOYGBvJKMUV7XeWhGsskAmTsvvnFxkc5PAD3Ct+liULjiQWlzDrmpTE8aMqLK4l0YQw7/8iRVz6gli42iEc2ZG56ob1ErpTLAKFWyCNOebZuGoygdEQaGTIIunAncXg5Rz07TdPl0Tf5ZZLpiAgR5ck0H1SETnjDTZ/S83CiVZWJgmCpu8YOKWyYRD4orWwdnA77L4+ixeojLIhEoNL8KlBgsP9Twx+fFMWLfxMmiuX+yksM6Hu+Lsm+Ao7Q284VPp36EB1rxP1JM7HCiEOEm50Jb6hNKjgN4aoLhG5yg+GnDhwCZqUwcRJo1bWtm3QvRA+rzrGZkId4EY3cyOK5QnYV5+24x93Ex0UspHMn7HGsHUESsVeV0fLqlfXyd2RbHTmDMP6w== Kubernikus Master Key" ,
93
+ SSHPublicKey : os . Getenv ( "KLUSTER_SSH_PUBLIC_KEY" ) ,
80
94
ClusterCIDR : & clusterCidr ,
81
95
NodePools : pools ,
82
96
Openstack : models.OpenstackSpec {
0 commit comments