Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions hack/verify-examples-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -51,11 +55,19 @@ res=0
KIND_CREATE_ATTEMPTED=true
kind create cluster --name "${CLUSTER_NAME}" || res=$?

cat <<EOF >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
Expand Down Expand Up @@ -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