Update Helm wrapper script

Small updates to incorporate shellcheck recommendations.

Change-Id: I450706b404735f07eef8cf605303363030db16b3
This commit is contained in:
Phil Sphicas 2022-03-14 07:50:37 -07:00
parent c64bf703e2
commit 79cb856fab
1 changed files with 8 additions and 6 deletions

View File

@ -1,20 +1,22 @@
#!/usr/bin/env bash
#!/bin/bash
set -e
IMAGE_HELM:="{{ config['HostSystem:images.helm.helm'] }}"
if [ "x$(pwd)" = "x/" ]; then
UPDIR=/
WORKDIR=/up
else
UPDIR=$(pwd)/..
WORKDIR=/up/$(basename $(pwd))
WORKDIR=/up/$(basename "$(pwd)")
fi
exec docker run --rm \
--net host \
-v $UPDIR:/up \
-v "$UPDIR":/up \
-v /etc/kubernetes/admin:/etc/kubernetes/admin \
-w $WORKDIR \
-w "$WORKDIR" \
-e KUBECONFIG=/etc/kubernetes/admin/kubeconfig.yaml \
{{ config['HostSystem:images.helm.helm'] }} \
$*
"$IMAGE_HELM" \
"$@"