mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
e2e-runner: Drop Trusty support in favor of GCI
Now that GCI (Google Container-VM Image) is out, we will start running e2e tests with it instead of Ubuntu Trusty. This change updates `e2e-runner.sh` to replace the Trusty related logic with GCI.
This commit is contained in:
parent
505fb85726
commit
fe7dd4cae7
@ -76,16 +76,16 @@ function unpack_binaries() {
|
|||||||
tar -xzf kubernetes-test.tar.gz
|
tar -xzf kubernetes-test.tar.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
# GCP Project to fetch Trusty images.
|
# GCP Project to fetch GCI images.
|
||||||
function get_trusty_image_project() {
|
function get_gci_image_project() {
|
||||||
local project=""
|
local project=""
|
||||||
# Retry the gsutil command a couple times to mitigate the effect of
|
# Retry the gsutil command a couple times to mitigate the effect of
|
||||||
# transient server errors.
|
# transient server errors.
|
||||||
for n in $(seq 3); do
|
for n in $(seq 3); do
|
||||||
project="$(gsutil cat "gs://trusty-images/image-project.txt")" && break || sleep 1
|
project="$(gsutil cat "gs://gci-staging/image-project.txt")" && break || sleep 1
|
||||||
done
|
done
|
||||||
if [[ -z "${project}" ]]; then
|
if [[ -z "${project}" ]]; then
|
||||||
echo "Failed to find the image project for Trusty images."
|
echo "Failed to find the image project for GCI images."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${project}"
|
echo "${project}"
|
||||||
@ -94,19 +94,19 @@ function get_trusty_image_project() {
|
|||||||
rm -rf .gsutil &> /dev/null
|
rm -rf .gsutil &> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the latest Trusty image for a Jenkins job.
|
# Get the latest GCI image of a type.
|
||||||
function get_latest_trusty_image() {
|
function get_latest_gci_image() {
|
||||||
local image_project="$1"
|
local image_project="$1"
|
||||||
local image_type="$2"
|
local image_type="$2"
|
||||||
local image_index=""
|
local image_index=""
|
||||||
if [[ "${image_type}" == head ]]; then
|
if [[ "${image_type}" == head ]]; then
|
||||||
image_index="trusty-head"
|
image_index="gci-head"
|
||||||
elif [[ "${image_type}" == dev ]]; then
|
elif [[ "${image_type}" == dev ]]; then
|
||||||
image_index="trusty-dev"
|
image_index="gci-dev"
|
||||||
elif [[ "${image_type}" == beta ]]; then
|
elif [[ "${image_type}" == beta ]]; then
|
||||||
image_index="trusty-beta"
|
image_index="gci-beta"
|
||||||
elif [[ "${image_type}" == stable ]]; then
|
elif [[ "${image_type}" == stable ]]; then
|
||||||
image_index="trusty-stable"
|
image_index="gci-stable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local image=""
|
local image=""
|
||||||
@ -116,7 +116,7 @@ function get_latest_trusty_image() {
|
|||||||
image="$(gsutil cat "gs://${image_project}/image-indices/latest-base-image-${image_index}")" && break || sleep 1
|
image="$(gsutil cat "gs://${image_project}/image-indices/latest-base-image-${image_index}")" && break || sleep 1
|
||||||
done
|
done
|
||||||
if [[ -z "${image}" ]]; then
|
if [[ -z "${image}" ]]; then
|
||||||
echo "Failed to find Trusty image for ${image_type}"
|
echo "Failed to find GCI image for ${image_type}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${image}"
|
echo "${image}"
|
||||||
@ -180,13 +180,13 @@ if [[ -n "${CLOUDSDK_BUCKET:-}" ]]; then
|
|||||||
export CLOUDSDK_CONFIG=/var/lib/jenkins/.config/gcloud
|
export CLOUDSDK_CONFIG=/var/lib/jenkins/.config/gcloud
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We get the image project and name for Trusty dynamically.
|
# We get the image project and name for GCI dynamically.
|
||||||
if [[ -n "${JENKINS_TRUSTY_IMAGE_TYPE:-}" ]]; then
|
if [[ -n "${JENKINS_GCI_IMAGE_TYPE:-}" ]]; then
|
||||||
trusty_image_project="$(get_trusty_image_project)"
|
gci_image_project="$(get_gci_image_project)"
|
||||||
trusty_image="$(get_latest_trusty_image "${trusty_image_project}" "${JENKINS_TRUSTY_IMAGE_TYPE}")"
|
gci_image="$(get_latest_gci_image "${gci_image_project}" "${JENKINS_GCI_IMAGE_TYPE}")"
|
||||||
export KUBE_GCE_MASTER_PROJECT="${trusty_image_project}"
|
export KUBE_GCE_MASTER_PROJECT="${gci_image_project}"
|
||||||
export KUBE_GCE_MASTER_IMAGE="${trusty_image}"
|
export KUBE_GCE_MASTER_IMAGE="${gci_image}"
|
||||||
export KUBE_OS_DISTRIBUTION="trusty"
|
export KUBE_OS_DISTRIBUTION="gci"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function e2e_test() {
|
function e2e_test() {
|
||||||
|
Loading…
Reference in New Issue
Block a user