@@ -17,7 +17,7 @@ github_repo="cilium/proxy"
17
17
github_branch=" main"
18
18
image=" quay.io/cilium/cilium-envoy"
19
19
20
- latest_commit_sha=" $( curl -s https://api.github.com/repos/${github_repo} /commits/${github_branch} | jq -r ' .sha' ) "
20
+ latest_commit_sha=" $( curl -s https://api.github.com/repos/${github_repo} /commits/${github_branch} | jq -r --exit-status ' .sha' ) "
21
21
envoy_version=" $( curl -s https://raw.githubusercontent.com/${github_repo} /" ${latest_commit_sha} " /ENVOY_VERSION) "
22
22
23
23
image_tag=" ${envoy_version// envoy-/ v} -${latest_commit_sha} "
30
30
31
31
echo " Latest image from branch ${github_branch} : ${image_full} "
32
32
33
- echo " Updating image in ./images/cilium/Dockerfile"
34
- sed -i -E " s|(FROM ${image} :)(.*)(@sha256:[0-9a-z]*)( as cilium-envoy)|\1${image_tag} @${image_sha256} \4|" ./images/cilium/Dockerfile
33
+ DOCKERFILEPATH=" ./images/cilium/Dockerfile"
34
+ echo " Updating image in ${DOCKERFILEPATH} "
35
+ sed -i -E " s|(FROM ${image} :)(.*)(@sha256:[0-9a-z]*)( as cilium-envoy)|\1${image_tag} @${image_sha256} \4|" ${DOCKERFILEPATH}
35
36
36
- echo " Updating image in ./install/kubernetes/cilium/values.yaml.tmpl"
37
- # Using tr to workaround matching the multiline regex with sed
38
- # yq would change formatting: https://github.com/mikefarah/yq/issues/465
39
- # use of envoy.image.override (which would allow match in one line) isn't optimal either
40
- < ./install/kubernetes/cilium/values.yaml.tmpl tr ' \n' ' \f' |
41
- sed -E " s|(# -- Envoy container image\..*tag: \" )(v[0-9a-zA-Z\.-]*)(\" )|\1${image_tag} \3|" |
42
- sed -E " s|(# -- Envoy container image\..*digest: \" )(sha256:[0-9a-z]*)(\" )|\1${image_sha256} \3|" |
43
- tr ' \f' ' \n' > ./install/kubernetes/cilium/values.yaml.tmpl_tmp &&
44
- mv ./install/kubernetes/cilium/values.yaml.tmpl_tmp ./install/kubernetes/cilium/values.yaml.tmpl
37
+ MAKEFILEPATH=" ./install/kubernetes/Makefile.values"
38
+ echo " Updating image in ${MAKEFILEPATH} "
39
+ sed -i -E " s|export[[:space:]]+CILIUM_ENVOY_VERSION:=.*|export CILIUM_ENVOY_VERSION:=${image_tag} |" ${MAKEFILEPATH}
40
+ sed -i -E " s|export[[:space:]]+CILIUM_ENVOY_DIGEST:=.*|export CILIUM_ENVOY_DIGEST:=${image_sha256} |" ${MAKEFILEPATH}
45
41
46
- echo " Please don't forget to execute 'make -C Documentation update-helm-values && make -C install/kubernetes'"
42
+ if git diff --exit-code ./install/kubernetes/Makefile.values ./images/cilium/Dockerfile & > /dev/null ; then
43
+ echo " The envoy image is already up to date"
44
+ else
45
+ echo " Updated the envoy image to be a latest version"
46
+ echo " Please don't forget to execute 'make -C Documentation update-helm-values && make -C install/kubernetes'"
47
+ fi
0 commit comments