Skip to content

Commit

Permalink
Merge pull request #34 from pohly/master
Browse files Browse the repository at this point in the history
deploy: avoid replacing socat image
  • Loading branch information
k8s-ci-robot authored Apr 10, 2019
2 parents 881ee2d + 0ed022c commit a72d13d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions deploy/util/deploy-hostpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ CSI_SNAPSHOTTER_RBAC_YAML="https://raw.githubusercontent.com/kubernetes-csi/exte

INSTALL_CRD=${INSTALL_CRD:-"false"}

# Some images are not affected by *_REGISTRY/*_TAG and IMAGE_* variables.
# The default is to update unless explicitly excluded.
update_image () {
case "$1" in socat) return 1;; esac
}

run () {
echo "$@" >&2
"$@"
Expand Down Expand Up @@ -121,9 +127,12 @@ for i in $(ls ${BASE_DIR}/hostpath/*.yaml | sort); do
# Now replace registry and/or tag, if set as env variables.
# If not set, the replacement is the same as the original value.
prefix=$(eval echo \${${varname}_REGISTRY:-${IMAGE_REGISTRY:-${registry}}}/ | sed -e 's;none/;;')
suffix=$(eval echo :\${${varname}_TAG:-${IMAGE_TAG:-${tag}}})
line="$(echo "$nocomments" | sed -e "s;$image;${prefix}${name}${suffix};")"
# Only do this for the images which are meant to be configurable.
if update_image "$name"; then
prefix=$(eval echo \${${varname}_REGISTRY:-${IMAGE_REGISTRY:-${registry}}}/ | sed -e 's;none/;;')
suffix=$(eval echo :\${${varname}_TAG:-${IMAGE_TAG:-${tag}}})
line="$(echo "$nocomments" | sed -e "s;$image;${prefix}${name}${suffix};")"
fi
echo " using $line" >&2
fi
echo "$line"
Expand Down Expand Up @@ -155,4 +164,4 @@ done
# deploy snapshotclass
echo "deploying snapshotclass"
kubectl create -f ${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml
kubectl apply -f ${BASE_DIR}/snapshotter/csi-hostpath-snapshotclass.yaml

0 comments on commit a72d13d

Please sign in to comment.