Skip to content

Commit 3d7822a

Browse files
Mate Orybrandond
authored andcommitted
pass --cacert flags to helm repo commands too
The job fails otherwise with the following: + helm_v3 repo add x 'https://x' Error: looks like "https://x" is not a valid chart repository or cannot be reached: Get "https://x/index.yaml": x509: certificate signed by unknown authority Signed-off-by: Mate Ory <mate.ory@banzaicloud.com>
1 parent 2b384f1 commit 3d7822a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

entry

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ helm_update() {
3333
# No current version and status, safe to install
3434
if [[ "${INSTALLED_VERSION}" =~ ^(|null)$ ]] && [[ "${STATUS}" =~ ^(|null)$ ]]; then
3535
echo "Installing ${HELM} chart" >> ${TERM_LOG}
36-
${HELM} "$@" ${NAME_ARG} ${NAME} "${CHART}" ${CA_FILE_ARG} ${TIMEOUT_ARG} ${VALUES}
36+
${HELM} "$@" ${NAME_ARG} ${NAME} "${CHART}" ${TIMEOUT_ARG} ${VALUES}
3737
exit
3838
fi
3939

@@ -49,7 +49,7 @@ helm_update() {
4949
echo "Retrying upgrade of ${HELM} chart" >> ${TERM_LOG}
5050
echo "Retrying upgrade of ${NAME}"
5151
shift 1
52-
${HELM} upgrade "$@" ${NAME} "${CHART}" ${CA_FILE_ARG} ${TIMEOUT_ARG} ${VALUES}
52+
${HELM} upgrade "$@" ${NAME} "${CHART}" ${TIMEOUT_ARG} ${VALUES}
5353
exit
5454
else
5555
STATUS=failed
@@ -68,7 +68,7 @@ helm_update() {
6868
echo "Upgrading ${HELM} chart" >> ${TERM_LOG}
6969
echo "Upgrading ${NAME}"
7070
shift 1
71-
${HELM} upgrade "$@" ${NAME} "${CHART}" ${CA_FILE_ARG} ${TIMEOUT_ARG} ${VALUES}
71+
${HELM} upgrade "$@" ${NAME} "${CHART}" ${TIMEOUT_ARG} ${VALUES}
7272
exit
7373
fi
7474

@@ -85,7 +85,7 @@ helm_update() {
8585
echo Deleted
8686
# Try installing now that we've uninstalled
8787
echo "Installing ${HELM} chart" >> ${TERM_LOG}
88-
${HELM} "$@" ${NAME_ARG} ${NAME} ${CHART} ${CA_FILE_ARG} ${TIMEOUT_ARG} ${VALUES}
88+
${HELM} "$@" ${NAME_ARG} ${NAME} ${CHART} ${TIMEOUT_ARG} ${VALUES}
8989
exit
9090
else
9191
echo "Release status is '${STATUS}' and failure policy is '${FAILURE_POLICY}', not 'reinstall'; waiting for operator intervention" >> ${TERM_LOG}
@@ -96,7 +96,7 @@ helm_update() {
9696

9797
# No special status handling necessary, do whatever we were asked to do
9898
echo "Installing ${HELM} chart" >> ${TERM_LOG}
99-
${HELM} "$@" ${NAME_ARG} ${NAME} "${CHART}" ${CA_FILE_ARG} ${TIMEOUT_ARG} ${VALUES}
99+
${HELM} "$@" ${NAME_ARG} ${NAME} "${CHART}" ${TIMEOUT_ARG} ${VALUES}
100100
}
101101

102102
helm_repo_init() {
@@ -109,15 +109,15 @@ helm_repo_init() {
109109

110110
if [[ "${HELM}" == "helm_v3" ]]; then
111111
if [[ ${CHART} == stable/* ]]; then
112-
${HELM} repo add stable ${STABLE_REPO_URL}
112+
${HELM} repo add ${CA_FILE_ARG} stable ${STABLE_REPO_URL}
113113
${HELM} repo update
114114
fi
115115
else
116116
${HELM} repo update --strict || ${HELM} repo remove stable
117117
fi
118118

119119
if [[ -n "${REPO}" ]]; then
120-
${HELM} repo add ${NAME%%/*} ${REPO}
120+
${HELM} repo add ${CA_FILE_ARG} ${NAME%%/*} ${REPO}
121121
${HELM} repo update
122122
fi
123123
}

0 commit comments

Comments
 (0)