From 2ca858a604241a596fc9a4ff1a26ee5b788df1ac Mon Sep 17 00:00:00 2001 From: Thiago Miranda Date: Mon, 20 Dec 2021 14:33:45 -0500 Subject: [PATCH] Change the entrypoint of the image to always use bash To fix the kubectl version in the commit that it depends on, the CUSTOMIZATION variable of the file stx-platformclients.stable_docker_image had to be used. But when we are building a new image with CUSTOMIZATION, the build-stx-images.sh script put a CMD ["bash"] in the image, making the old way to call commands in stx-platformclients to no longer work. This commit solves this issue, by forcing the entrypoint to always use bash and making all commands run as with "bash -c " Test Plan: - Tested this change with new and old stx-platformclients versions. It work with the image that has the kubectl fix and the older ones. Partial-Bug: #1955427 Depends-on: https://review.opendev.org/c/starlingx/upstream/+/822356 Signed-off-by: Thiago Miranda Change-Id: Ieae227daee875bc4b4b42509cbcb78350360d02c --- remote_cli/client_wrapper.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/remote_cli/client_wrapper.sh b/remote_cli/client_wrapper.sh index 0ed1cb7..6700f9b 100755 --- a/remote_cli/client_wrapper.sh +++ b/remote_cli/client_wrapper.sh @@ -85,11 +85,11 @@ else fi if [[ "$FORCE_SHELL" == "true" ]]; then - exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --entrypoint /bin/bash --workdir /wd ${CLIENT_IMAGE_NAME} -c "$*" elif [[ "$FORCE_NO_SHELL" == "true" ]]; then - exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --entrypoint /bin/bash --workdir /wd ${CLIENT_IMAGE_NAME} -c "$*" elif [ -z "$2" ]; then - exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --entrypoint /bin/bash --workdir /wd ${CLIENT_IMAGE_NAME} -c "$*" else - exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --entrypoint /bin/bash --workdir /wd ${CLIENT_IMAGE_NAME} -c "$*" fi