Skip to content

Commit 028acf4

Browse files
committed
Include make target for bumping echo-basic in our conformance files
1 parent 3959576 commit 028acf4

File tree

3 files changed

+66
-8
lines changed

3 files changed

+66
-8
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ verify:
126126
docs:
127127
hack/make-docs.sh
128128

129+
.PHONY: update-conformance-image-refs
130+
update-conformance-image-refs:
131+
hack/update-conformance-image-refs.sh
132+
129133
# Verify if support Docker Buildx.
130134
.PHONY: image.buildx.verify
131135
image.buildx.verify:

conformance/base/manifests.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spec:
115115
containers:
116116
- name: infra-backend-v1
117117
# From https://github.com/kubernetes-sigs/ingress-controller-conformance/tree/master/images/echoserver
118-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
118+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
119119
env:
120120
- name: POD_NAME
121121
valueFrom:
@@ -161,7 +161,7 @@ spec:
161161
spec:
162162
containers:
163163
- name: infra-backend-v2
164-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
164+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
165165
env:
166166
- name: POD_NAME
167167
valueFrom:
@@ -207,7 +207,7 @@ spec:
207207
spec:
208208
containers:
209209
- name: infra-backend-v3
210-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
210+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
211211
env:
212212
- name: POD_NAME
213213
valueFrom:
@@ -253,7 +253,7 @@ spec:
253253
spec:
254254
containers:
255255
- name: tls-backend
256-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
256+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
257257
volumeMounts:
258258
- name: secret-volume
259259
mountPath: /etc/secret-volume
@@ -322,7 +322,7 @@ spec:
322322
spec:
323323
containers:
324324
- name: tls-backend
325-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
325+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
326326
volumeMounts:
327327
- name: secret-volume
328328
mountPath: /etc/secret-volume
@@ -384,7 +384,7 @@ spec:
384384
spec:
385385
containers:
386386
- name: app-backend-v1
387-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
387+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
388388
env:
389389
- name: POD_NAME
390390
valueFrom:
@@ -430,7 +430,7 @@ spec:
430430
spec:
431431
containers:
432432
- name: app-backend-v2
433-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
433+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
434434
env:
435435
- name: POD_NAME
436436
valueFrom:
@@ -483,7 +483,7 @@ spec:
483483
spec:
484484
containers:
485485
- name: web-backend
486-
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231005-v0.8.1-68-gd4ff2d4f
486+
image: gcr.io/k8s-staging-gateway-api/echo-basic:v20231013-v0.8.1-125-gd9014aa2
487487
env:
488488
- name: POD_NAME
489489
valueFrom:

hack/update-conformance-image-refs.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# Copyright 2023 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
set -o errexit
19+
set -o nounset
20+
set -o pipefail
21+
22+
# Wrap sed to deal with GNU and BSD sed flags.
23+
run::sed() {
24+
local -r vers="$(sed --version < /dev/null 2>&1 | grep -q GNU && echo gnu || echo bsd)"
25+
case "$vers" in
26+
gnu) sed -i "$@" ;;
27+
*) sed -i '' "$@" ;;
28+
esac
29+
}
30+
31+
IMAGES=(
32+
gcr.io/k8s-staging-gateway-api/echo-basic
33+
)
34+
35+
# Export so we can use run::sed in subshells
36+
# https://stackoverflow.com/questions/4321456/find-exec-a-shell-function-in-linux
37+
export -f run::sed
38+
39+
for IMAGE in ${IMAGES[@]}; do
40+
echo "Fetching latest tags for $IMAGE"
41+
TAG_FILE=$(mktemp)
42+
go run github.com/google/go-containerregistry/cmd/gcrane@latest ls "$IMAGE" --json \
43+
| jq -r '.tags[]' \
44+
| grep -v latest \
45+
| sort -rV \
46+
| head -n1 > "$TAG_FILE"
47+
48+
export IMAGE_TAG=$(cat "$TAG_FILE")
49+
export IMAGE
50+
echo "Found tag $IMAGE_TAG - updating manifests..."
51+
find . -type f -name "*.yaml" -exec bash -c 'run::sed -e "s,image:.*echo-basic.*$,image: ${IMAGE}:${IMAGE_TAG},g" "$0"' {} \;
52+
done
53+
54+

0 commit comments

Comments
 (0)