Skip to content

Commit

Permalink
refs platform/#3231: enforce the set of the default namespace for the…
Browse files Browse the repository at this point in the history
… current context if the KUBE_NAMESPACE variable is not defined (#247)
  • Loading branch information
Monska85 authored Nov 7, 2024
1 parent 1f642e0 commit 1ccada1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/src/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,8 @@ _setup-gitlab-agent-kubernetes-context() {

kubectl config use-context "${1}:${2}"

if [ -n "${KUBE_NAMESPACE}" ]; then
echo "Setting the namespace to: ${KUBE_NAMESPACE}"
kubectl config set-context --current --namespace="${KUBE_NAMESPACE}"
fi
echo "Setting the namespace to: ${KUBE_NAMESPACE:-default}"
kubectl config set-context --current --namespace="${KUBE_NAMESPACE:-default}"
}

setup-gitlab-agent() {
Expand Down

0 comments on commit 1ccada1

Please sign in to comment.