Skip to content

Commit 1e037bb

Browse files
authored
Merge pull request #1415 from tokers/chore/enhance-verify-examples-kind.sh
chore: remove workaround logics in verify-examples-kind.sh
2 parents 0647412 + 5307ca5 commit 1e037bb

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

hack/verify-examples-kind.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ readonly GO111MODULE="on"
2222
readonly GOFLAGS="-mod=readonly"
2323
readonly GOPATH="$(mktemp -d)"
2424
readonly CLUSTER_NAME="verify-gateway-api"
25+
readonly ADMISSION_WEBHOOK_VERSION="v0.5.1"
2526

2627
export KUBECONFIG="${GOPATH}/.kubeconfig"
2728
export 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
5155
KIND_CREATE_ATTEMPTED=true
5256
kind 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
5569
docker 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
6173
for check in {1..10}; do
@@ -105,9 +117,6 @@ for CHANNEL in experimental standard; do
105117
echo Examples failed as expected
106118
done
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
112121
cleanup || res=$?
113122
exit $res

0 commit comments

Comments
 (0)