Skip to content

Commit

Permalink
Fix networkservicemesh#2245 Create NSM_NAMESPACE if missing on helm-i…
Browse files Browse the repository at this point in the history
…nstall-nsm (networkservicemesh#2246)

* Fix networkservicemesh#2245 Create NSM_NAMESPACE if missing on helm install

This change fixes issue networkservicemesh#2245 . It updates the helm-nsm-install script to create the NSM_NAMESPACE if it does not already exist. Helm no longer will create namespaces if they don't exist, and so this is required so that the install that happens later in the script does not fail.

Signed-off-by: Chris Johnston <[email protected]>

* lint: wrap $NSM_NAMESPACE in double quotes to prevent globbing

This change fixes a linting issue which was failing the build. The
NSM_NAMESPACE parameter was not wrapped in double quotes.

See: https://www.shellcheck.net/wiki/SC2086

Signed-off-by: Chris Johnston <[email protected]>
  • Loading branch information
Chris-Johnston authored May 6, 2021
1 parent f2cf913 commit ee71e77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/helm-nsm-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ else
exit 1
fi

if (! kubectl get namespace | grep -q "$NSM_NAMESPACE" ); then
echo "Creating namespace: $NSM_NAMESPACE"
kubectl create namespace "$NSM_NAMESPACE"
fi

set -o xtrace
# shellcheck disable=SC2086
$HELM install $VERSION_SPECIFIC_OPTS \
Expand Down

0 comments on commit ee71e77

Please sign in to comment.