Skip to content

Commit a72d13d

Browse files
authored
Merge pull request #34 from pohly/master
deploy: avoid replacing socat image
2 parents 881ee2d + 0ed022c commit a72d13d

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

deploy/util/deploy-hostpath.sh

Lines changed: 13 additions & 4 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"
@@ -155,4 +164,4 @@ done
155164
156165
# deploy snapshotclass
157166
echo "deploying snapshotclass"
158-
kubectl create -f ${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml
167+
kubectl apply -f ${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml

0 commit comments

Comments
 (0)