Skip to content

Commit

Permalink
fix: create namespace if it is not created yet
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <[email protected]>
  • Loading branch information
leninmehedy committed Sep 18, 2023
1 parent 2b9c3bc commit b042f65
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dev/scripts/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ function setup_temp_dir() {
echo "File list in ${TMP_DIR}"
ls -la "${TMP_DIR}"
fi

cat "${TMP_DIR}/.env"
}

function load_env_file() {
Expand All @@ -47,6 +45,11 @@ function setup_kubectl_context() {
[[ -z "${CLUSTER_NAME}" ]] && echo "ERROR: Cluster name is required" && return 1
[[ -z "${NAMESPACE}" ]] && echo "ERROR: Namespace name is required" && return 1

kubectl get ns "${NAMESPACE}" &>/dev/null
if [[ $? -ne 0 ]]; then
kubectl create ns "${NAMESPACE}"
fi

echo "List of namespaces:"
kubectl get ns

Expand Down

0 comments on commit b042f65

Please sign in to comment.