Skip to content

Commit

Permalink
Merge pull request #2 from BGLCorp/update_confirm_context
Browse files Browse the repository at this point in the history
Update confirm context to allow no context
  • Loading branch information
jgournet authored Jun 9, 2020
2 parents 5df68e8 + 9ece8cf commit ee81ddc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _global/confirm_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

CURRENT_CONTEXT=$(kubectl config current-context | tr -d '\n')

if [[ "${CURRENT_CONTEXT}" = "" ]]; then
echo "No current context => No issues"
exit 0
fi

if [[ "${CURRENT_CONTEXT}" = *${1} ]]; then
if [[ "${CURRENT_CONTEXT}" = *${2}* ]]; then
echo "Current context '${CURRENT_CONTEXT}' ends with the input '${1}' and has the right account id ${2}"
Expand Down

0 comments on commit ee81ddc

Please sign in to comment.