Skip to content

Commit

Permalink
added check for the ns direct change
Browse files Browse the repository at this point in the history
  • Loading branch information
catalinpan committed Nov 24, 2019
1 parent ad16b9c commit 17ab846
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/km
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set +x

version=v0.0.1-beta3
version=v0.0.1-beta4
programname=$0
red="$(tput setaf 1)"
green="$(tput setaf 2)"
Expand Down Expand Up @@ -217,6 +217,12 @@ change_cluster_context(){
}
change_namespace_context(){
if ! echo $(kubectl get ns --no-headers=true -o custom-columns=":metadata.name" | tr "\n" " ") | ${grep} -wq ${namespace:-empty}
then
error "$namespace namespace doesn't exist"
namespace=""
fi
if [ -z "${namespace}" ]
then
current_cluster="$(kubectl config current-context)"
Expand Down

0 comments on commit 17ab846

Please sign in to comment.