From 17555f9c73074dafdd4bf649878886d0322744df Mon Sep 17 00:00:00 2001 From: Matt Moore Date: Tue, 24 Mar 2020 08:24:09 -0700 Subject: [PATCH] [master] Auto-update dependencies (#236) Produced via: `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh` /assign n3wscott vagababov /cc n3wscott vagababov --- Gopkg.lock | 6 ++--- vendor/knative.dev/pkg/test/cmd/command.go | 23 ++++++++++++++++++- .../testutils/clustermanager/e2e-tests/gke.go | 7 ++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 04379eba..a7bab94b 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -966,7 +966,7 @@ [[projects]] branch = "master" - digest = "1:b866a374c5f954ec0830aa3c31962f4f8777624a77eba2b99fb19c732d5c2452" + digest = "1:7912249df5f43ca10fa1c3f8a3febdc3c0f7b320698787fa73c9fb1920a832d6" name = "knative.dev/pkg" packages = [ "apis", @@ -986,7 +986,7 @@ "reconciler", ] pruneopts = "T" - revision = "aa5b1f2211ac4a538128a4a4e03797e9232b0431" + revision = "0840da9555a3a75f801abc1d654fb00dfe9a687a" [[projects]] branch = "master" @@ -997,7 +997,7 @@ "tools/dep-collector", ] pruneopts = "UT" - revision = "0bc1e8bb1582a8738da1b5c485084a84bf76f17c" + revision = "0042e9ca752c8339c3c245e1d2c76b891a144b7e" [[projects]] digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c" diff --git a/vendor/knative.dev/pkg/test/cmd/command.go b/vendor/knative.dev/pkg/test/cmd/command.go index 1fa2c372..5eb8a02f 100644 --- a/vendor/knative.dev/pkg/test/cmd/command.go +++ b/vendor/knative.dev/pkg/test/cmd/command.go @@ -33,8 +33,25 @@ const ( separator = "\n" ) +// Option enables further configuration of a Cmd. +type Option func(cmd *exec.Cmd) + +// WithEnvs returns an option that adds env vars for the given Cmd. +func WithEnvs(envs []string) Option { + return func(c *exec.Cmd) { + c.Env = envs + } +} + +// WithDir returns an option that adds dir for the given Cmd. +func WithDir(dir string) Option { + return func(c *exec.Cmd) { + c.Dir = dir + } +} + // RunCommand will run the command and return the standard output, plus error if there is one. -func RunCommand(cmdLine string) (string, error) { +func RunCommand(cmdLine string, options ...Option) (string, error) { cmdSplit, err := shell.Split(cmdLine) if len(cmdSplit) == 0 || err != nil { return "", &CommandLineError{ @@ -47,6 +64,10 @@ func RunCommand(cmdLine string) (string, error) { cmdName := cmdSplit[0] args := cmdSplit[1:] cmd := exec.Command(cmdName, args...) + for _, option := range options { + option(cmd) + } + var eb bytes.Buffer cmd.Stderr = &eb diff --git a/vendor/knative.dev/pkg/testutils/clustermanager/e2e-tests/gke.go b/vendor/knative.dev/pkg/testutils/clustermanager/e2e-tests/gke.go index 9cd141fe..cdb2eff6 100644 --- a/vendor/knative.dev/pkg/testutils/clustermanager/e2e-tests/gke.go +++ b/vendor/knative.dev/pkg/testutils/clustermanager/e2e-tests/gke.go @@ -78,6 +78,8 @@ type GKECluster struct { Request *GKERequest // Project might be GKE specific, so put it here Project string + // IsBoskos is true if the GCP project used is managed by boskos + IsBoskos bool // NeedsCleanup tells whether the cluster needs to be deleted afterwards // This probably should be part of task wrapper's logic NeedsCleanup bool @@ -181,12 +183,13 @@ func (gc *GKECluster) Acquire() error { // Get project name from boskos if running in Prow, otherwise it should fail // since we don't know which project to use - if common.IsProw() { + if gc.Request.Project == "" && common.IsProw() { project, err := gc.boskosOps.AcquireGKEProject(gc.Request.ResourceType) if err != nil { return fmt.Errorf("failed acquiring boskos project: '%v'", err) } gc.Project = project.Name + gc.IsBoskos = true } if gc.Project == "" { return errors.New("GCP project must be set") @@ -268,7 +271,7 @@ func (gc *GKECluster) Delete() error { gc.ensureProtected() // Release Boskos if running in Prow, will let Janitor taking care of // clusters deleting - if common.IsProw() { + if gc.IsBoskos { log.Printf("Releasing Boskos resource: '%v'", gc.Project) return gc.boskosOps.ReleaseGKEProject(gc.Project) }