From 911e00986fe4e9839a86b1abc006ac1fb259b074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Jord=C3=A3o=20Jardim?= Date: Fri, 16 Apr 2021 07:39:28 -0400 Subject: [PATCH] Add volume map to keep the repositories.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This solution is to keep the data from the helm config. The helm repo commands are managed locally and that is the reason that the command helm repo add works, the file doesn't exist but this command creates that, but when it runs helm repo list the file repositories.yml doesn't exist anymore because the container execution didn't keep that. Attention: In the solution it is mapping the default path /root/.config/helm/ and /root/.cache/helm/ inside the container, if for some reason the it is changed passing a flag --repository-config or --repository-cache this new path must be changed in the client_wrapper.sh file, otherwise it will come back to the same behavior. There is no reason to change this default path, it is inside the container of the remote cli, but we have to keep it in mind, for some possible future issues. Closes-bug: 1925802 Signed-off-by: Rafael Jordão Jardim Change-Id: I3180513b76c75221b6143a6da4d45a600e477662 (cherry picked from commit 8a7f010ce3e79f16644cdbf5b0b19268dfe1a88f) --- remote_cli/client_wrapper.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/remote_cli/client_wrapper.sh b/remote_cli/client_wrapper.sh index 3c28a1b..08d0efa 100755 --- a/remote_cli/client_wrapper.sh +++ b/remote_cli/client_wrapper.sh @@ -7,6 +7,8 @@ # KUBE_CFG_PATH="/root/.kube/config" +HELM_CONFIG_PATH="/root/.config/helm" +HELM_CACHE_PATH="/root/.cache/helm" SHELL_TYPE=$(uname -s) @@ -16,9 +18,9 @@ if [[ "$CONFIG_TYPE" = "platform" ]]; then if [[ "${SHELL_TYPE}" == *"CYGWIN"* ]]; then # On Windows 10, native docker needs the full windows path, not the UNIX one, # so we pass the UNIX path through cygpath - VOLUME_LIST="--volume $(cygpath -m ${OSC_WORKDIR}):/wd --volume $(cygpath -m ${K8S_CONFIG_FILE}):${KUBE_CFG_PATH}" + VOLUME_LIST="--volume $(cygpath -m ${OSC_WORKDIR}):/wd --volume $(cygpath -m ${K8S_CONFIG_FILE}):${KUBE_CFG_PATH} --volume $(cygpath -m ${OSC_WORKDIR}/.helm):${HELM_CONFIG_PATH} --volume $(cygpath -m ${OSC_WORKDIR}/.cache):${HELM_CACHE_PATH}" else - VOLUME_LIST="--volume ${OSC_WORKDIR}:/wd --volume ${K8S_CONFIG_FILE}:${KUBE_CFG_PATH}" + VOLUME_LIST="--volume ${OSC_WORKDIR}:/wd --volume ${K8S_CONFIG_FILE}:${KUBE_CFG_PATH} --volume ${OSC_WORKDIR}/.helm:${HELM_CONFIG_PATH} --volume ${OSC_WORKDIR}/.cache:${HELM_CACHE_PATH}" fi else CLIENT_IMAGE_NAME="${APPLICATION_DOCKER_IMAGE}"