@@ -22,6 +22,7 @@ readonly GO111MODULE="on"
2222readonly GOFLAGS=" -mod=readonly"
2323readonly GOPATH=" $( mktemp -d) "
2424readonly CLUSTER_NAME=" verify-gateway-api"
25+ readonly ADMISSION_WEBHOOK_VERSION=" v0.5.1"
2526
2627export KUBECONFIG=" ${GOPATH} /.kubeconfig"
2728export GOFLAGS GO111MODULE GOPATH
@@ -33,6 +34,9 @@ cleanup() {
3334 if [ " $CLEANED_UP " = " true" ]; then
3435 return
3536 fi
37+
38+ rm config/webhook/kustomization.yaml
39+
3640 if [ " ${KIND_CREATE_ATTEMPTED:- } " = true ]; then
3741 kind delete cluster --name " ${CLUSTER_NAME} " || true
3842 fi
@@ -51,11 +55,19 @@ res=0
5155KIND_CREATE_ATTEMPTED=true
5256kind create cluster --name " ${CLUSTER_NAME} " || res=$?
5357
58+ cat << EOF >config/webhook/kustomization.yaml
59+ resources:
60+ - 0-namespace.yaml
61+ - certificate_config.yaml
62+ - admission_webhook.yaml
63+ images:
64+ - name: gcr.io/k8s-staging-gateway-api/admission-server:${ADMISSION_WEBHOOK_VERSION}
65+ newTag: latest
66+ EOF
67+
5468# Install webhook
5569docker build -t gcr.io/k8s-staging-gateway-api/admission-server:latest .
56- # Temporary workaround for release
57- sed -i ' s/v0.5.1/latest/g' config/webhook/admission_webhook.yaml
58- kubectl apply -f config/webhook/
70+ kubectl apply -k config/webhook/
5971
6072# Wait for webhook to be ready
6173for check in {1..10}; do
@@ -105,9 +117,6 @@ for CHANNEL in experimental standard; do
105117 echo Examples failed as expected
106118done
107119
108- # Undo workaround from earlier
109- sed -i ' s/latest/v0.5.1/g' config/webhook/admission_webhook.yaml
110-
111120# Clean up and exit
112121cleanup || res=$?
113122exit $res
0 commit comments