diff --git a/test/scripts/install-contour-working.sh b/test/scripts/install-contour-working.sh index 313206ed7fc..95189f7a2a7 100755 --- a/test/scripts/install-contour-working.sh +++ b/test/scripts/install-contour-working.sh @@ -44,15 +44,13 @@ if ! kind::cluster::exists "$CLUSTERNAME" ; then exit 2 fi -# Set (pseudo) random image tag to trigger restarts at every deployment. -# TODO: Come up with a scheme that doesn't fill up the dev environment with randomly-tagged images. -VERSION="v$$" +docker rmi ghcr.io/projectcontour/contour:latest --force # Build the image. -make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=${VERSION} +make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=latest # Push the Contour build image into the cluster. -kind::cluster::load::docker ghcr.io/projectcontour/contour:${VERSION} +kind::cluster::load::docker ghcr.io/projectcontour/contour:latest # Install Contour ${KUBECTL} apply -f ${REPO}/examples/contour/00-common.yaml @@ -71,11 +69,14 @@ for file in ${REPO}/examples/contour/02-job-certgen.yaml ${REPO}/examples/contou # we built above. sed \ "-es|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|" \ - "-es|image: ghcr.io/projectcontour/contour:.*$|image: ghcr.io/projectcontour/contour:${VERSION}|" \ + "-es|image: ghcr.io/projectcontour/contour:.*$|image: ghcr.io/projectcontour/contour:latest|" \ "$file" | \ ${KUBECTL} apply -f - done +# Patching the deployment with timestamp will trigger pod restart. +${KUBECTL} patch deployment -n projectcontour contour --patch '{"spec": {"template": {"metadata": {"annotations": {"timestamp": "'$(date +%s)'"}}}}}' + # Wait for Contour and Envoy to report "Ready" status. ${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=contour deployments --for=condition=Available ${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l app=envoy pods --for=condition=Ready diff --git a/test/scripts/install-provisioner-working.sh b/test/scripts/install-provisioner-working.sh index 8933297934a..a9b582f0c32 100755 --- a/test/scripts/install-provisioner-working.sh +++ b/test/scripts/install-provisioner-working.sh @@ -28,18 +28,16 @@ if ! kind::cluster::exists "$CLUSTERNAME" ; then exit 2 fi -# Set (pseudo) random image tag to trigger restarts at every deployment. -# TODO: Come up with a scheme that doesn't fill up the dev environment with randomly-tagged images. -VERSION="v$$" +docker rmi ghcr.io/projectcontour/contour:latest --force # Build the Contour Provisioner image. -make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=${VERSION} +make -C ${REPO} container IMAGE=ghcr.io/projectcontour/contour VERSION=latest # Push the Contour Provisioner image into the cluster. -kind::cluster::load::docker ghcr.io/projectcontour/contour:${VERSION} +kind::cluster::load::docker ghcr.io/projectcontour/contour:latest # Install the Gateway provisioner using the loaded image. -export CONTOUR_IMG=ghcr.io/projectcontour/contour:${VERSION} +export CONTOUR_IMG=ghcr.io/projectcontour/contour:latest ${KUBECTL} apply -f examples/gateway-provisioner/00-common.yaml ${KUBECTL} apply -f examples/gateway-provisioner/01-roles.yaml @@ -49,6 +47,9 @@ ${KUBECTL} apply -f <(cat examples/gateway-provisioner/03-gateway-provisioner.ya yq eval '.spec.template.spec.containers[0].imagePullPolicy = "IfNotPresent"' - | \ yq eval '.spec.template.spec.containers[0].args += "--contour-image="+env(CONTOUR_IMG)' -) +# Patching the deployment with timestamp will trigger pod restart. +${KUBECTL} patch deployment -n projectcontour contour-gateway-provisioner --patch '{"spec": {"template": {"metadata": {"annotations": {"timestamp": "'$(date +%s)'"}}}}}' + # Wait for the provisioner to report "Ready" status. ${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l control-plane=contour-gateway-provisioner deployments --for=condition=Available ${KUBECTL} wait --timeout="${WAITTIME}" -n projectcontour -l control-plane=contour-gateway-provisioner pods --for=condition=Ready