diff --git a/hack/verify-examples-kind.sh b/hack/verify-examples-kind.sh index 9b73c21266..e1e26fe3d8 100755 --- a/hack/verify-examples-kind.sh +++ b/hack/verify-examples-kind.sh @@ -22,6 +22,7 @@ readonly GO111MODULE="on" readonly GOFLAGS="-mod=readonly" readonly GOPATH="$(mktemp -d)" readonly CLUSTER_NAME="verify-gateway-api" +readonly ADMISSION_WEBHOOK_VERSION="v0.5.1" export KUBECONFIG="${GOPATH}/.kubeconfig" export GOFLAGS GO111MODULE GOPATH @@ -33,6 +34,9 @@ cleanup() { if [ "$CLEANED_UP" = "true" ]; then return fi + + rm config/webhook/kustomization.yaml + if [ "${KIND_CREATE_ATTEMPTED:-}" = true ]; then kind delete cluster --name "${CLUSTER_NAME}" || true fi @@ -51,11 +55,19 @@ res=0 KIND_CREATE_ATTEMPTED=true kind create cluster --name "${CLUSTER_NAME}" || res=$? +cat <config/webhook/kustomization.yaml +resources: + - 0-namespace.yaml + - certificate_config.yaml + - admission_webhook.yaml +images: + - name: gcr.io/k8s-staging-gateway-api/admission-server:${ADMISSION_WEBHOOK_VERSION} + newTag: latest +EOF + # Install webhook docker build -t gcr.io/k8s-staging-gateway-api/admission-server:latest . -# Temporary workaround for release -sed -i 's/v0.5.1/latest/g' config/webhook/admission_webhook.yaml -kubectl apply -f config/webhook/ +kubectl apply -k config/webhook/ # Wait for webhook to be ready for check in {1..10}; do @@ -105,9 +117,6 @@ for CHANNEL in experimental standard; do echo Examples failed as expected done -# Undo workaround from earlier -sed -i 's/latest/v0.5.1/g' config/webhook/admission_webhook.yaml - # Clean up and exit cleanup || res=$? exit $res