@@ -21,6 +21,7 @@ import (
21
21
"fmt"
22
22
"os"
23
23
"path/filepath"
24
+ "strconv"
24
25
25
26
. "github.com/onsi/ginkgo/v2"
26
27
. "github.com/onsi/gomega"
@@ -56,6 +57,8 @@ type K8SConformanceSpecInput struct {
56
57
func K8SConformanceSpec (ctx context.Context , inputGetter func () K8SConformanceSpecInput ) {
57
58
const (
58
59
kubetestConfigurationVariable = "KUBETEST_CONFIGURATION"
60
+ kubetestNumberOfNodesVariable = "KUBETEST_NUMBER_OF_NODES"
61
+ kubetestGinkgoNodesVariable = "KUBETEST_GINKGO_NODES"
59
62
)
60
63
var (
61
64
specName = "k8s-conformance"
@@ -118,15 +121,29 @@ func K8SConformanceSpec(ctx context.Context, inputGetter func() K8SConformanceSp
118
121
119
122
workloadProxy := input .BootstrapClusterProxy .GetWorkloadCluster (ctx , namespace .Name , clusterResources .Cluster .Name )
120
123
124
+ var err error
125
+
126
+ numberOfNodes := int (workerMachineCount )
127
+ if s , ok := os .LookupEnv (kubetestNumberOfNodesVariable ); ok && s != "" {
128
+ numberOfNodes , err = strconv .Atoi (s )
129
+ Expect (err ).ToNot (HaveOccurred (), "Failed to parse kubetestNumberOfNodesVariable to int" )
130
+ }
131
+
132
+ ginkgoNodes := int (workerMachineCount )
133
+ if s , ok := os .LookupEnv (kubetestGinkgoNodesVariable ); ok && s != "" {
134
+ ginkgoNodes , err = strconv .Atoi (s )
135
+ Expect (err ).ToNot (HaveOccurred (), "Failed to parse kubetestGinkgoNodesVariable to int" )
136
+ }
137
+
121
138
// Start running conformance test suites.
122
- err : = kubetest .Run (
139
+ err = kubetest .Run (
123
140
ctx ,
124
141
kubetest.RunInput {
125
142
ClusterProxy : workloadProxy ,
126
- NumberOfNodes : int ( workerMachineCount ) ,
143
+ NumberOfNodes : numberOfNodes ,
127
144
ArtifactsDirectory : input .ArtifactFolder ,
128
145
ConfigFilePath : kubetestConfigFilePath ,
129
- GinkgoNodes : int ( workerMachineCount ) ,
146
+ GinkgoNodes : ginkgoNodes ,
130
147
},
131
148
)
132
149
Expect (err ).ToNot (HaveOccurred (), "Failed to run Kubernetes conformance" )
0 commit comments