Skip to content

Commit 0bd3181

Browse files
committed
deploy: avoid replacing socat image
Setting IMAGE_TAG or IMAGE_REGISTRY unintentionally also affected the socat image. Now we disable updating that image completely, i.e. SOCAT_IMAGE_TAG/REGISTRY also have no effect, but that should not be needed and wasn't documented either.
1 parent ea18a33 commit 0bd3181

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

deploy/util/deploy-hostpath.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/exte
8282

8383
INSTALL_CRD=${INSTALL_CRD:-"false"}
8484

85+
# Some images are not affected by *_REGISTRY/*_TAG and IMAGE_* variables.
86+
# The default is to update unless explicitly excluded.
87+
update_image () {
88+
case "$1" in socat) return 1;; esac
89+
}
90+
8591
run () {
8692
echo "$@" >&2
8793
"$@"
@@ -121,9 +127,12 @@ for i in $(ls ${BASE_DIR}/hostpath/*.yaml | sort); do
121127
122128
# Now replace registry and/or tag, if set as env variables.
123129
# If not set, the replacement is the same as the original value.
124-
prefix=$(eval echo \${${varname}_REGISTRY:-${IMAGE_REGISTRY:-${registry}}}/ | sed -e 's;none/;;')
125-
suffix=$(eval echo :\${${varname}_TAG:-${IMAGE_TAG:-${tag}}})
126-
line="$(echo "$nocomments" | sed -e "s;$image;${prefix}${name}${suffix};")"
130+
# Only do this for the images which are meant to be configurable.
131+
if update_image "$name"; then
132+
prefix=$(eval echo \${${varname}_REGISTRY:-${IMAGE_REGISTRY:-${registry}}}/ | sed -e 's;none/;;')
133+
suffix=$(eval echo :\${${varname}_TAG:-${IMAGE_TAG:-${tag}}})
134+
line="$(echo "$nocomments" | sed -e "s;$image;${prefix}${name}${suffix};")"
135+
fi
127136
echo " using $line" >&2
128137
fi
129138
echo "$line"

0 commit comments

Comments
 (0)