Skip to content

Commit

Permalink
fix: Pick up region/zone from created cluster info
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
  • Loading branch information
abayer committed Jul 2, 2019
1 parent d803a68 commit 52b9afd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jenkins-x-tekton.yml
Expand Up @@ -77,7 +77,7 @@ pipelineConfig:
args: ['--dockerfile=/workspace/source/Dockerfile.builder-go','--destination=docker.io/jenkinsxio/builder-go:covered-${inputs.params.version}','--context=/workspace/source','--cache-repo=jenkins-x-docker-registry.jx.svc.cluster.local:5000/','--cache=true','--cache-dir=/workspace','--skip-tls-verify-registry=jenkins-x-docker-registry.jx.svc.cluster.local:5000']

- name: tekton-e2e-tests
image: jenkinsxio/builder-go:0.0.0-SNAPSHOT-PR-4515-44
image: jenkinsxio/builder-go:0.1.537
command: ./jx/bdd/tekton/ci.sh

- name: stash-test-results
Expand Down
6 changes: 5 additions & 1 deletion pkg/cmd/step_bdd.go
Expand Up @@ -774,16 +774,20 @@ func (o *StepBDDOptions) ensureTestEnvironmentRepoSetup(requirements *config.Req

func (o *StepBDDOptions) deleteCluster(cluster *bdd.CreateCluster) error {
projectID := ""
region := ""
for _, arg := range cluster.Args {
if strings.Contains(arg, "project-id=") {
projectID = strings.Split(arg, "=")[1]
break
}
if strings.Contains(arg, "z=") || strings.Contains(arg, "zone=") || strings.Contains(arg, "region=") {
region = strings.Split(arg, "=")[1]
}
}
if projectID != "" {
labelOptions := e2e.StepE2ELabelOptions{
ProjectID: projectID,
Delete: true,
Region: region,
StepOptions: opts.StepOptions{
CommonOptions: &opts.CommonOptions{},
},
Expand Down

0 comments on commit 52b9afd

Please sign in to comment.