Skip to content

Commit 6381633

Browse files
committed
adding starts with test for auxImage.sh
1 parent 8d169a8 commit 6381633

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

operator/src/main/resources/scripts/auxImage.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2024, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44

55
# Init container script for the auxiliary image feature.
@@ -26,6 +26,21 @@ scriptDir="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
2626

2727
if [ "${debug}" == "true" ]; then set -x; fi;
2828

29+
# This script runs in the auxiliary image container, which is often using
30+
# busybox or some other very sparse base image. This script relies on
31+
# the determining that the shell supports the "starts with" test so
32+
# make sure that it works and exit if it does not.
33+
34+
SHELL_TEST=abcd
35+
if [[ "${SHELL_TEST}" == "ab"* ]]; then
36+
SHELL_IS_GOOD=true
37+
fi
38+
39+
if [ -z "${SHELL_IS_GOOD}" ]; then
40+
echo "[SEVERE] The shell in the auxiliary image is missing required functionality. Exiting."
41+
exit 1
42+
fi
43+
2944
. ${scriptDir}/utils_base.sh
3045
[ $? -ne 0 ] && echo "[SEVERE] Missing file ${scriptDir}/utils_base.sh" && exit 1
3146
UNKNOWN_SHELL=true

0 commit comments

Comments
 (0)