From d5372e73873ce2d413baecdf8ccf8d33d631883e Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Tue, 28 Jun 2022 20:23:30 +0200 Subject: [PATCH 1/2] Use PULL_PULL_SHA as gcs location sha if available --- tests/e2e/kubetest2-kops/deployer/build.go | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/e2e/kubetest2-kops/deployer/build.go b/tests/e2e/kubetest2-kops/deployer/build.go index 3dbf98ff72..a813f4aca9 100644 --- a/tests/e2e/kubetest2-kops/deployer/build.go +++ b/tests/e2e/kubetest2-kops/deployer/build.go @@ -92,14 +92,17 @@ func defaultStageLocation(kopsRoot string) (string, error) { jobName = defaultJobName } - cmd := exec.Command("git", "rev-parse", "--short", "HEAD") - cmd.SetDir(kopsRoot) - output, err := exec.CombinedOutputLines(cmd) - if err != nil { - return "", err - } else if len(output) != 1 { - return "", fmt.Errorf("unexpected output from git describe: %v", output) + sha := os.Getenv("PULL_PULL_SHA") + if sha == "" { + cmd := exec.Command("git", "rev-parse", "--short", "HEAD") + cmd.SetDir(kopsRoot) + output, err := exec.CombinedOutputLines(cmd) + if err != nil { + return "", err + } else if len(output) != 1 { + return "", fmt.Errorf("unexpected output from git describe: %v", output) + } + sha = strings.TrimSpace(output[0]) } - sha := strings.TrimSpace(output[0]) return fmt.Sprintf(defaultGCSPath, jobName, sha), nil } From bac19f15e3b365b719de82c7496ee31b15943015 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Tue, 28 Jun 2022 20:37:01 +0200 Subject: [PATCH 2/2] Update test version docs --- docs/contributing/test_versions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing/test_versions.md b/docs/contributing/test_versions.md index 33a9ecc8a7..988721d10f 100644 --- a/docs/contributing/test_versions.md +++ b/docs/contributing/test_versions.md @@ -34,7 +34,7 @@ When a PR builds successfully, you can test the PR using the following script: ```sh pr=13208 sha=$(curl -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/kubernetes/kops/pulls/${pr} | jq -r .head.sha ) -export KOPS_BASE_URL=https://storage.googleapis.com/kops-ci/pulls/pull-kops-e2e-kubernetes-aws/pull-v1.24.0-alpha.2-68-g8a1070a1b9 +export KOPS_BASE_URL="https://storage.googleapis.com/kops-ci/pulls/pull-kops-e2e-kubernetes-aws/pull-${sha}" wget -q "$KOPS_BASE_URL/$(go env GOOS)/$(go env GOARCH)/kops" chmod +x ./kops ./kops version