Merge pull request #11801 from olemarkus/presubmit-scenario

Run scenarios as presubmit tests
This commit is contained in:
Kubernetes Prow Robot 2021-06-21 07:06:51 -07:00 committed by GitHub
commit e64c9c2c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 10 deletions

View File

@ -157,6 +157,19 @@ func (d *deployer) verifyKopsFlags() error {
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 {
case "aws":
case "gce":

View File

@ -42,8 +42,7 @@ ${KUBETEST2} \
haveds
# Upgrade to a version that should adopt existing resources and apply the change below
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
KOPS=$(kops-download-from-base)
KOPS=$(kops-acquire-latest)
cp "${KOPS}" "${WORKSPACE}/kops"

View File

@ -17,9 +17,7 @@
REPO_ROOT=$(git rev-parse --show-toplevel);
source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh
export KOPS_BASE_URL
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
KOPS=$(kops-download-from-base)
KOPS=$(kops-acquire-latest)
OVERRIDES="${OVERRIDES-} --override=cluster.spec.cloudConfig.awsEBSCSIDriver.enabled=true"
OVERRIDES="$OVERRIDES --override=cluster.spec.snapshotController.enabled=true"

View File

@ -22,10 +22,6 @@ set -o xtrace
echo "CLOUD_PROVIDER=${CLOUD_PROVIDER}"
echo "CLUSTER_NAME=${CLUSTER_NAME}"
if [[ -n "${KOPS_BASE_URL-}" ]]; then
unset KOPS_BASE_URL
fi
if [[ -z "${WORKSPACE-}" ]]; then
export WORKSPACE
WORKSPACE=$(mktemp -dt kops.XXXXXXXXX)
@ -61,7 +57,7 @@ if [[ -z "${AWS_SSH_PUBLIC_KEY_FILE-}" ]]; then
export AWS_SSH_PUBLIC_KEY_FILE="${HOME}/.ssh/id_rsa.pub"
fi
KUBETEST2="kubetest2 kops -v=2 --cloud-provider=${CLOUD_PROVIDER} --cluster-name=${CLUSTER_NAME:-}"
KUBETEST2="kubetest2 kops -v=2 --cloud-provider=${CLOUD_PROVIDER} --cluster-name=${CLUSTER_NAME:-} --kops-root=${REPO_ROOT}"
KUBETEST2="${KUBETEST2} --admin-access=${ADMIN_ACCESS:-} --env=KOPS_FEATURE_FLAGS=${KOPS_FEATURE_FLAGS}"
# Always tear-down the cluster when we're done
@ -97,6 +93,21 @@ function kops-base-from-marker() {
fi
}
# This function will download the latest kops if in a periodic job, otherwise build from the current tree
function kops-acquire-latest() {
if [[ "${JOB_TYPE-}" == "periodic" ]]; then
export KOPS_BASE_URL
KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)"
kops-download-from-base
else
if [[ -n "${KOPS_BASE_URL-}" ]]; then
unset KOPS_BASE_URL
fi
$KUBETEST2 --build >&2
echo .bazelbuild/dist/linux/amd64/kops
fi
}
function kops-up() {
local create_args
create_args="--networking ${NETWORKING} ${OVERRIDES-}"