Add volume map to keep the repositories.yml

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 <RafaelJordao.Jardim@windriver.com>
Change-Id: I3180513b76c75221b6143a6da4d45a600e477662
(cherry picked from commit 8a7f010ce3)
This commit is contained in:
Rafael Jordão Jardim 2021-04-16 07:39:28 -04:00 committed by Rafael Jordão Jardim
parent 1292740b4d
commit 911e00986f
1 changed files with 4 additions and 2 deletions

View File

@ -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}"