Merge pull request #13174 from olemarkus/ab-version

Add support for AB tests starting out with released kops version
This commit is contained in:
Kubernetes Prow Robot 2022-02-03 18:27:59 -08:00 committed by GitHub
commit 4afc826e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 17 deletions

View File

@ -66,9 +66,10 @@ func (d *deployer) verifyBuildFlags() error {
} }
d.StageLocation = stageLocation d.StageLocation = stageLocation
} }
if d.KopsBaseURL == "" { if d.KopsBaseURL == "" && os.Getenv("KOPS_BASE_URL") == "" {
d.KopsBaseURL = strings.Replace(d.StageLocation, "gs://", "https://storage.googleapis.com/", 1) d.KopsBaseURL = strings.Replace(d.StageLocation, "gs://", "https://storage.googleapis.com/", 1)
} }
fi, err := os.Stat(d.KopsRoot) fi, err := os.Stat(d.KopsRoot)
if err != nil { if err != nil {
return err return err

View File

@ -156,19 +156,6 @@ func (d *deployer) verifyKopsFlags() error {
return errors.New("missing required --kops-binary-path when --kops-version-marker is not used") return errors.New("missing required --kops-binary-path when --kops-version-marker is not used")
} }
// when we use a binary path, we want to use the corresponding nodeup et.al
if d.KopsBinaryPath != "" {
baseUrl := os.Getenv("KOPS_BASE_URL")
if baseUrl == "" {
stageLocation, err := defaultStageLocation(d.KopsRoot)
if err != nil {
return err
}
d.KopsBaseURL = strings.Replace(stageLocation, "gs://", "https://storage.googleapis.com/", 1)
}
}
switch d.CloudProvider { switch d.CloudProvider {
case "aws": case "aws":
case "gce": case "gce":

View File

@ -39,9 +39,16 @@ ${KUBETEST2} \
--down \ --down \
--kops-binary-path="${KOPS_B}" || echo "kubetest2 down failed" --kops-binary-path="${KOPS_B}" || echo "kubetest2 down failed"
# First kOps version may be a released version. If so, it is prefixed with v
if [[ "${KOPS_VERSION_A:0:1}" == "v" ]]; then
KOPS_BASE_URL=""
KOPS_A=$(kops-download-release "$KOPS_VERSION_A")
KOPS="${KOPS_A}"
else
KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_A}") KOPS_BASE_URL=$(kops-base-from-marker "${KOPS_VERSION_A}")
KOPS_A=$(kops-download-from-base) KOPS_A=$(kops-download-from-base)
KOPS="${KOPS_A}" KOPS="${KOPS_A}"
fi
${KUBETEST2} \ ${KUBETEST2} \
--up \ --up \