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

Create kubectl-get-in-shell.yaml #2789

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions plugins/kubectl-get-in-shell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins:
# provides a way to continue working on the currently selected object in a new shell without doing lengthy copy/paste of current context.
# It simply formats the `kubectl get` command, taking care to omit -n when the namespace is not defined (typically for cluster-wide resources)
kubectl-get-cmd:
shortCut: Shift-B
confirm: false
description: get into shell
scopes:
- all
command: bash
background: false
args:
- -c
- (printf "copy/paste in a shell:\n\n"; if [ "$NAMESPACE" != "" -a "$NAMESPACE" != "-" ]; then printf "kubectl get --context $CONTEXT -n $NAMESPACE $RESOURCE_NAME $NAME \n" ; else printf "kubectl get --context $CONTEXT $RESOURCE_NAME $NAME \n"; fi ) |& less