1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-06 21:07:49 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Jans Rautenbach
a40aee27cc
Merge 1e511d8c5c into 72acd2ca90 2025-12-08 08:37:06 -08:00
Jans Rautenbach
1e511d8c5c
feat(kubectl): get and set current context namespace
Signed-off-by: Jans Rautenbach <git@moat.rauten.co.za>
2025-07-16 10:53:31 +02:00
2 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,8 @@ plugins=(... kubectl)
| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig |
| kccc | `kubectl config current-context` | Display the current-context |
| kcgc | `kubectl config get-contexts` | List of contexts available |
| kcsetns | `kcsc --current --namespace` | Update the current context namespace |
| kcgetns | `k config view --minify -o jsonpath=...` | Get the current context namespace |
| | | **General aliases** |
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |

View File

@ -24,11 +24,13 @@ alias kaf='kubectl apply -f'
# Drop into an interactive terminal on a container
alias keti='kubectl exec -t -i'
# Manage configuration quickly to switch contexts between local, dev ad staging.
# Manage configuration quickly to switch contexts between local, dev and staging.
alias kcuc='kubectl config use-context'
alias kcsc='kubectl config set-context'
alias kcdc='kubectl config delete-context'
alias kccc='kubectl config current-context'
alias kcsetns="kcsc --current --namespace"
alias kcgetns="k config view --minify -o 'jsonpath={.contexts[0].context.namespace}'"
# List all contexts
alias kcgc='kubectl config get-contexts'