Skip to content

Commit

Permalink
Merge pull request #1415 from tokers/chore/enhance-verify-examples-ki…
Browse files Browse the repository at this point in the history
…nd.sh

chore: remove workaround logics in verify-examples-kind.sh
  • Loading branch information
k8s-ci-robot authored Oct 4, 2022
2 parents 0647412 + 5307ca5 commit 1e037bb
Showing 1 changed file with 15 additions and 6 deletions.
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

0 comments on commit 1e037bb

Please sign in to comment.