Skip to content

Commit 370f4f3

Browse files
committed
fix empty imagestream var
1 parent 523dd96 commit 370f4f3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

hack/deploy-logging.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
# If you have a specific CLO or EO image you want to use, specify them by using
3131
# CLO_IMAGE and EO_IMAGE.
3232

33-
set -eux
33+
set -euo pipefail
34+
if [ "${DEBUG:-}" = "true" ]; then
35+
set -x
36+
fi
3437

3538
logging_err_exit() {
3639
set +e
@@ -186,12 +189,12 @@ construct_image_name() {
186189
# stable is the imagestream containing the images built for this PR, or
187190
# otherwise the most recent image
188191
if [ -n "${IMAGE_FORMAT:-}" ] ; then
189-
if [ "${LOGGING_IMAGE_STREAM:-}" != 'stable' ] ; then
192+
if [ -n "${LOGGING_IMAGE_STREAM:-}" -a "${LOGGING_IMAGE_STREAM:-}" != 'stable' ] ; then
190193
local match=/stable:
191194
local replace="/${LOGGING_IMAGE_STREAM}:"
192195
IMAGE_FORMAT=${IMAGE_FORMAT/$match/$replace}
193196

194-
if [ "${LOGGING_IMAGE_STREAM_NS:-}" != 'ocp' ] ; then
197+
if [ -n "${LOGGING_IMAGE_STREAM_NS:-}" -a "${LOGGING_IMAGE_STREAM_NS:-}" != 'ocp' ] ; then
195198
local ns=$(echo ${IMAGE_FORMAT} | cut -d '/' -f 2)
196199
IMAGE_FORMAT=${IMAGE_FORMAT/$ns/$LOGGING_IMAGE_STREAM_NS}
197200
fi

0 commit comments

Comments
 (0)