File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import (
20
20
"fmt"
21
21
"os"
22
22
"path/filepath"
23
+ "strings"
23
24
"time"
24
25
25
26
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
@@ -34,6 +35,7 @@ var log = logf.RuntimeLog.WithName("test-env")
34
35
35
36
// Default binary path for test framework
36
37
const (
38
+ envUseExistingCluster = "USE_EXISTING_CLUSTER"
37
39
envKubeAPIServerBin = "TEST_ASSET_KUBE_APISERVER"
38
40
envEtcdBin = "TEST_ASSET_ETCD"
39
41
envKubectlBin = "TEST_ASSET_KUBECTL"
@@ -122,6 +124,10 @@ func (te Environment) getAPIServerFlags() []string {
122
124
123
125
// Start starts a local Kubernetes server and updates te.ApiserverPort with the port it is listening on
124
126
func (te * Environment ) Start () (* rest.Config , error ) {
127
+ if ! te .UseExistingCluster {
128
+ // Check USE_EXISTING_CLUSTER env then
129
+ te .UseExistingCluster = strings .ToLower (os .Getenv (envUseExistingCluster )) == "true"
130
+ }
125
131
if te .UseExistingCluster {
126
132
log .V (1 ).Info ("using existing cluster" )
127
133
if te .Config == nil {
You can’t perform that action at this time.
0 commit comments