Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompt: Add `run' to tigger commands #47

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubectl-prompt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ${YELLOW}Command: ${COMMAND}\n${RESTORE}"
# Skip checks if user has not assigned any (using kubectl prompt add [-n namespace OR -c cluster]
if [[ ! -z "$KUBECTL_NAMESPACE_PROMPT" ]] || [[ ! -z "$KUBECTL_CLUSTER_PROMPT" ]]; then
# Only prompt when the command would cause the state of the env to change.
echo "$@" | grep "deploy\|create\|apply\|set \|delete\|scale " 1>/dev/null
echo "$@" | grep "deploy\|create\|apply\|set \|delete\|scale \|run" 1>/dev/null
if [ $? -eq 0 ]; then
NAMESPACE=$(kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}{{ .context.namespace }}{{ end }}{{ end }}')
CLUSTER=$(kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}{{ .context.cluster }}{{ end }}{{ end }}')
Expand Down