From e725c6eb180995c43142bed753995993e89e7a2e Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Wed, 28 Sep 2022 11:50:06 +0800 Subject: [PATCH 1/3] chore: remove workaround logics in verify-examples-kind.sh Signed-off-by: Chao Zhang --- config/webhook/kustomization.yaml | 7 +++++++ hack/verify-examples-kind.sh | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 config/webhook/kustomization.yaml diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml new file mode 100644 index 0000000000..f05ec8274c --- /dev/null +++ b/config/webhook/kustomization.yaml @@ -0,0 +1,7 @@ +resources: + - 0-namespace.yaml + - certificate_config.yaml + - admission_webhook.yaml +images: + - name: gcr.io/k8s-staging-gateway-api/admission-server:v0.5.0 + newTag: latest diff --git a/hack/verify-examples-kind.sh b/hack/verify-examples-kind.sh index c80961aa22..bcbb0bac59 100755 --- a/hack/verify-examples-kind.sh +++ b/hack/verify-examples-kind.sh @@ -33,6 +33,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 +54,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:v0.5.0 + 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.0/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 +116,6 @@ for CHANNEL in experimental standard; do echo Examples failed as expected done -# Undo workaround from earlier -sed -i 's/latest/v0.5.0/g' config/webhook/admission_webhook.yaml - # Clean up and exit cleanup || res=$? exit $res From 1866cd3b747d35e7cc0d34e762080fea9b1bc313 Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Wed, 28 Sep 2022 11:57:14 +0800 Subject: [PATCH 2/3] fix Signed-off-by: Chao Zhang --- config/webhook/kustomization.yaml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 config/webhook/kustomization.yaml diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml deleted file mode 100644 index f05ec8274c..0000000000 --- a/config/webhook/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -resources: - - 0-namespace.yaml - - certificate_config.yaml - - admission_webhook.yaml -images: - - name: gcr.io/k8s-staging-gateway-api/admission-server:v0.5.0 - newTag: latest From 5307ca53e81bdb3e05c9355dccdd2573e0dce94b Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Fri, 30 Sep 2022 17:08:07 +0800 Subject: [PATCH 3/3] feat: add the ADMISSION_WEBHOOK_VERSION Signed-off-by: Chao Zhang --- hack/verify-examples-kind.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/verify-examples-kind.sh b/hack/verify-examples-kind.sh index bcbb0bac59..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 @@ -60,7 +61,7 @@ resources: - certificate_config.yaml - admission_webhook.yaml images: - - name: gcr.io/k8s-staging-gateway-api/admission-server:v0.5.0 + - name: gcr.io/k8s-staging-gateway-api/admission-server:${ADMISSION_WEBHOOK_VERSION} newTag: latest EOF