GC kubemark image after cluster starts up

pull/8/head
Shyam Jeedigunta 2018-08-31 18:56:36 +02:00
parent 14eb029fba
commit 63ce112d9e
3 changed files with 14 additions and 0 deletions

View File

@ -3130,3 +3130,8 @@ function ssh-to-node() {
function prepare-e2e() {
detect-project
}
# Delete the image given by $1.
function delete-image() {
gcloud container images delete --quiet "$1"
}

View File

@ -39,6 +39,7 @@ MASTER_OS_DISTRIBUTION=${KUBE_MASTER_OS_DISTRIBUTION:-gci}
NODE_OS_DISTRIBUTION=${KUBE_NODE_OS_DISTRIBUTION:-gci}
MASTER_IMAGE=${KUBE_GCE_MASTER_IMAGE:-cos-stable-65-10323-64-0}
MASTER_IMAGE_PROJECT=${KUBE_GCE_MASTER_PROJECT:-cos-cloud}
CLEANUP_KUBEMARK_IMAGE=${CLEANUP_KUBEMARK_IMAGE:-true}
# GPUs supported in GCE do not have compatible drivers in Debian 7.
if [[ "${NODE_OS_DISTRIBUTION}" == "debian" ]]; then

View File

@ -220,6 +220,14 @@ function create-and-upload-hollow-node-image {
cd $CURR_DIR
fi
echo "Created and uploaded the kubemark hollow-node image to docker registry."
# Cleanup the kubemark image after the script exits.
if [[ "${CLEANUP_KUBEMARK_IMAGE:-}" == "true" ]]; then
trap delete-kubemark-image EXIT
fi
}
function delete-kubemark-image {
delete-image "${KUBEMARK_IMAGE_REGISTRY}/kubemark:${KUBEMARK_IMAGE_TAG}"
}
# Generate secret and configMap for the hollow-node pods to work, prepare