mirror of https://github.com/kubernetes/kops.git
Merge pull request #11801 from olemarkus/presubmit-scenario
Run scenarios as presubmit tests
This commit is contained in:
commit
e64c9c2c45
|
|
@ -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":
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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-}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue