Skip to content

Commit 110c274

Browse files
authored
Merge pull request #2 from macmiranda/fix/revert-namespace-create-flag
Revert "Moved namespace creation to helm flag"
2 parents 337f620 + e034fbb commit 110c274

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: deploy.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ else
4646
update-kubeconfig --name ${CLUSTER_NAME}
4747
fi
4848

49+
# Check if namespace exists and create it if it doesn't.
50+
KUBE_NAMESPACE_EXISTS=$(kubectl get namespaces | _grep ^${DEPLOY_NAMESPACE})
51+
if [ -z "${KUBE_NAMESPACE_EXISTS}" ]; then
52+
echo "The namespace ${DEPLOY_NAMESPACE} does not exists. Creating..."
53+
kubectl create namespace "${DEPLOY_NAMESPACE}"
54+
else
55+
echo "The namespace ${DEPLOY_NAMESPACE} exists. Skipping creation..."
56+
fi
57+
58+
4959
# If defined, will set up authentication parameters
5060
if [ "${HELM_ACTION}" == "install" ] && [ "${OCI_REGISTRY}" != "true" ]; then
5161

@@ -125,7 +135,7 @@ fi
125135

126136
if [ "${HELM_ACTION}" == "install" ]; then
127137
# Upgrade or install the chart. This does it all.
128-
HELM_COMMAND="helm upgrade --install --create-namespace --timeout ${TIMEOUT} ${HELM_AUTH}"
138+
HELM_COMMAND="helm upgrade --install --timeout ${TIMEOUT} ${HELM_AUTH}"
129139

130140
# If we should wait, then do so
131141
if [ -n "${HELM_WAIT}" ]; then

0 commit comments

Comments
 (0)