Skip to content

Commit

Permalink
Create kubectl-get-in-shell.yaml (#2789)
Browse files Browse the repository at this point in the history
* Create kubectl-get-in-shell.yaml

Provide a way to continue working on the currently selected object in a new shell without doing lengthy copy/pastes

* Update kubectl-get-in-shell.yaml

Refine comment
  • Loading branch information
gberche-orange authored Aug 15, 2024
1 parent 3293ba4 commit a6e7b65
Showing 1 changed file with 16 additions and 0 deletions.
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


0 comments on commit a6e7b65

Please sign in to comment.