Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#175 from Namanl2001/image-conig-dir
Browse files Browse the repository at this point in the history
Configuring --gcp-project-type and --runtime-config
  • Loading branch information
k8s-ci-robot authored Nov 23, 2021
2 parents 86a9558 + fa3d337 commit 3081017
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pkg/testers/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ import (
var GitTag string

const (
target = "test-e2e-node"
gceProjectResourceType = "gce-project"
ciPrivateKeyEnv = "GCE_SSH_PRIVATE_KEY_FILE"
ciPublicKeyEnv = "GCE_SSH_PUBLIC_KEY_FILE"
target = "test-e2e-node"
ciPrivateKeyEnv = "GCE_SSH_PRIVATE_KEY_FILE"
ciPublicKeyEnv = "GCE_SSH_PUBLIC_KEY_FILE"
)

type Tester struct {
Expand All @@ -61,6 +60,8 @@ type Tester struct {
ImageConfigFile string `desc:"Path to a file containing image configuration."`
ImageConfigDir string `desc:"Path to image config files."`
Parallelism int `desc:"The number of nodes to run in parallel."`
GCPProjectType string `desc:"Explicitly indicate which project type to select from boskos."`
RuntimeConfig string `desc:"The runtime configuration for the API server. Format: a list of key=value pairs."`

// boskos struct field will be non-nil when the deployer is
// using boskos to acquire a GCP project
Expand All @@ -84,6 +85,7 @@ func NewDefaultTester() *Tester {
BoskosHeartbeatIntervalSeconds: 5 * 60,
Parallelism: 8,
boskosHeartbeatClose: make(chan struct{}),
GCPProjectType: "gce-project",
}
}

Expand Down Expand Up @@ -135,7 +137,7 @@ func (t *Tester) Execute() error {

resource, err := boskos.Acquire(
t.boskos,
gceProjectResourceType,
t.GCPProjectType,
time.Duration(t.BoskosAcquireTimeoutSeconds)*time.Second,
time.Duration(t.BoskosHeartbeatIntervalSeconds)*time.Second,
t.boskosHeartbeatClose,
Expand Down Expand Up @@ -243,6 +245,9 @@ func (t *Tester) constructArgs() []string {
"SSH_USER=" + t.sshUser,
"SSH_KEY=" + t.privateKey,
}
if t.RuntimeConfig != "" {
argsFromFlags = append(argsFromFlags, "RUNTIME_CONFIG="+t.RuntimeConfig)
}
return append(defaultArgs, argsFromFlags...)
}

Expand Down

0 comments on commit 3081017

Please sign in to comment.