billions-airline-85860
04/27/2025, 4:26 PMinitContainers:
- args:
- |
set -ex
EMPTY_DIR_MOUNT="/emptydir"
PROVIDERS_SUBDIR="app-providers-dir"
FINAL_DEST_DIR="$EMPTY_DIR_MOUNT/$PROVIDERS_SUBDIR"
mkdir -p "$FINAL_DEST_DIR"
THEME_JAR_NAME="keycloak-theme.jar"
DOWNLOAD_URL="<https://github.com/my-repo/keycloak-theme/releases/download/v0.0.1/keycloak-theme-for-kc-all-other-versions.jar>"
FORCE_DOWNLOAD="${FORCE_THEME_DOWNLOAD:-false}"
THEME_JAR_PATH="$FINAL_DEST_DIR/$THEME_JAR_NAME"
if [[ "$FORCE_DOWNLOAD" == "true" || ! -e "$THEME_JAR_PATH" ]]; then
echo "Downloading theme..."
curl -L -f -S -o "$THEME_JAR_PATH" "$DOWNLOAD_URL"
echo "Download complete."
else
echo "Theme already downloaded or force download is disabled. Skipping download."
fi
echo "Setting ownership and permissions for theme file and directory..."
chown -R 1001:1001 "$EMPTY_DIR_MOUNT"
echo "Verifying contents and permissions in emptyDir before exit:"
ls -la "$EMPTY_DIR_MOUNT"/
echo "Verifying contents and permissions in providers subdirectory:"
ls -la "$FINAL_DEST_DIR"/
echo "Init container complete."
When I save the file/ start the upgrade, Rancher changes it to this:
initContainers:
- args:
- > # now an arrow instead of the pipe.
And some of the lines are incorrectly formated. If I happen to update again with this change, the script doesn't work properly.
Why is Rancher changing the pipe to an arrow and reformatting the script code?
Scottwitty-jelly-95845
04/28/2025, 7:31 AMbillions-airline-85860
04/28/2025, 9:54 AM