From e9348575371aa8ec8811356d997942559c026d07 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 24 Feb 2022 19:23:41 +0100 Subject: fix(kubectl): support completion for snap installs (#10727) --- plugins/kubectl/kubectl.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index eed5727d1..89efeaca5 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -11,11 +11,11 @@ if (( $+commands[kubectl] )); then # If the completion file does not exist, generate it and then source it # Otherwise, source it and regenerate in the background if [[ ! -f "$ZSH_CACHE_DIR/completions/_kubectl" ]]; then - kubectl completion zsh >| "$ZSH_CACHE_DIR/completions/_kubectl" + kubectl completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubectl" >/dev/null source "$ZSH_CACHE_DIR/completions/_kubectl" else source "$ZSH_CACHE_DIR/completions/_kubectl" - kubectl completion zsh >| "$ZSH_CACHE_DIR/completions/_kubectl" &| + kubectl completion zsh | tee "$ZSH_CACHE_DIR/completions/_kubectl" >/dev/null &| fi fi -- cgit v1.2.3-70-g09d2 From 3343891ea6e8fd84632fabc6bc11a43f8b024e9e Mon Sep 17 00:00:00 2001 From: Vitul Rana Date: Mon, 7 Mar 2022 15:08:56 +0530 Subject: feat(kubectl): add aliases for job management (#9992) --- plugins/kubectl/README.md | 5 +++++ plugins/kubectl/kubectl.plugin.zsh | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index f6651c8cd..f77788482 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -120,6 +120,11 @@ plugins=(... kubectl) | kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | | kdcj | `kubectl describe cronjob` | Describe a CronJob in details | | kdelcj | `kubectl delete cronjob` | Delete the CronJob | +| | | **Job management** | +| kgj | `kubectl get job` | List all Job in ps output format | +| kej | `kubectl edit job` | Edit a Job in details | +| kdj | `kubectl describe job` | Describe the Job | +| kdelj | `kubectl delete job` | Delete the Job | ## Wrappers diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 89efeaca5..3e87c2395 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -178,6 +178,12 @@ alias kecj='kubectl edit cronjob' alias kdcj='kubectl describe cronjob' alias kdelcj='kubectl delete cronjob' +# Job management. +alias kgj='kubectl get job' +alias kej='kubectl edit job' +alias kdj='kubectl describe job' +alias kdelj='kubectl delete job' + # Only run if the user actually has kubectl installed if (( ${+_comps[kubectl]} )); then function kj() { kubectl "$@" -o json | jq; } -- cgit v1.2.3-70-g09d2 From d4c939d61ebd204599240a60d7473bbc241fb5b7 Mon Sep 17 00:00:00 2001 From: Eric Semeniuc <3838856+esemeniuc@users.noreply.github.com> Date: Mon, 7 Mar 2022 01:43:05 -0800 Subject: feat(kubectl): add aliases for replicasets (#10100) --- plugins/kubectl/README.md | 8 +++++--- plugins/kubectl/kubectl.plugin.zsh | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index f77788482..579a90b3b 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -22,7 +22,7 @@ plugins=(... kubectl) | kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | | 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 +| kcgc | `kubectl config get-contexts` | List of contexts available | | | | **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 | @@ -71,9 +71,11 @@ plugins=(... kubectl) | kdeld | `kubectl delete deployment` | Delete the deployment | | ksd | `kubectl scale deployment` | Scale a deployment | | krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | -| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | | | | **Rollout management** | -| kgrs | `kubectl get rs` | To see the ReplicaSet `rs` created by the deployment | +| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | +| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | +| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | | krh | `kubectl rollout history` | Check the revisions of this deployment | | kru | `kubectl rollout undo` | Rollback to the previous revision | | | | **Port forwarding** | diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 3e87c2395..0ee252ac3 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -112,7 +112,9 @@ function kres(){ } # Rollout management. -alias kgrs='kubectl get rs' +alias kgrs='kubectl get replicaset' +alias kdrs='kubectl describe replicaset' +alias kers='kubectl edit replicaset' alias krh='kubectl rollout history' alias kru='kubectl rollout undo' -- cgit v1.2.3-70-g09d2 From 3f214329d631b3ae39d6b283262c77819a0078de Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 28 Mar 2022 13:38:49 +0200 Subject: chore: removing old completion code (#10616) --- plugins/cargo/cargo.plugin.zsh | 8 -------- plugins/deno/deno.plugin.zsh | 13 ------------- plugins/fnm/fnm.plugin.zsh | 13 ------------- plugins/gh/gh.plugin.zsh | 13 ------------- plugins/helm/helm.plugin.zsh | 9 --------- plugins/kubectl/kubectl.plugin.zsh | 9 --------- plugins/rbw/rbw.plugin.zsh | 6 ------ plugins/rust/rust.plugin.zsh | 5 ----- plugins/rustup/rustup.plugin.zsh | 8 -------- plugins/volta/volta.plugin.zsh | 5 ----- 10 files changed, 89 deletions(-) (limited to 'plugins/kubectl/kubectl.plugin.zsh') diff --git a/plugins/cargo/cargo.plugin.zsh b/plugins/cargo/cargo.plugin.zsh index e4b338207..692025e8f 100644 --- a/plugins/cargo/cargo.plugin.zsh +++ b/plugins/cargo/cargo.plugin.zsh @@ -1,14 +1,6 @@ print ${(%):-'%F{yellow}The `cargo` plugin is deprecated and has been moved to the `rust` plugin.'} print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'} -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated completion file -command rm -f "${0:A:h}/_cargo" "$ZSH_CACHE_DIR/cargo_version" - (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || { fpath=("$ZSH/plugins/rust" $fpath) source "$ZSH/plugins/rust/rust.plugin.zsh" diff --git a/plugins/deno/deno.plugin.zsh b/plugins/deno/deno.plugin.zsh index 6c12bae13..7708f84df 100644 --- a/plugins/deno/deno.plugin.zsh +++ b/plugins/deno/deno.plugin.zsh @@ -16,19 +16,6 @@ if (( ! $+commands[deno] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated files -command rm -f "${0:A:h}/_deno" "$ZSH_CACHE_DIR/deno_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_deno" ]]; then diff --git a/plugins/fnm/fnm.plugin.zsh b/plugins/fnm/fnm.plugin.zsh index 044e16a04..6219025cd 100644 --- a/plugins/fnm/fnm.plugin.zsh +++ b/plugins/fnm/fnm.plugin.zsh @@ -2,19 +2,6 @@ if (( ! $+commands[fnm] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# remove old generated files -command rm -f "${0:A:h}/_fnm" "$ZSH_CACHE_DIR/fnm_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `fnm`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_fnm" ]]; then diff --git a/plugins/gh/gh.plugin.zsh b/plugins/gh/gh.plugin.zsh index 9263220ca..1d8d84c55 100644 --- a/plugins/gh/gh.plugin.zsh +++ b/plugins/gh/gh.plugin.zsh @@ -3,19 +3,6 @@ if (( ! $+commands[gh] )); then return fi -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated files -command rm -f "${0:A:h}/_gh" "$ZSH_CACHE_DIR/gh_version" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `gh`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_gh" ]]; then diff --git a/plugins/helm/helm.plugin.zsh b/plugins/helm/helm.plugin.zsh index 05bb19a44..151c43d88 100644 --- a/plugins/helm/helm.plugin.zsh +++ b/plugins/helm/helm.plugin.zsh @@ -2,15 +2,6 @@ if (( ! $+commands[helm] )); then return fi -# TODO: 2021-12-28: delete this block -# Remove old generated file -command rm -f "${ZSH_CACHE_DIR}/helm_completion" - -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file does not exist, generate it and then source it # Otherwise, source it and regenerate in the background if [[ ! -f "$ZSH_CACHE_DIR/completions/_helm" ]]; then diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 0ee252ac3..095d2b328 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -1,13 +1,4 @@ if (( $+commands[kubectl] )); then - # TODO: 2022-01-05: remove this block - # remove old generated files - command rm -f "$ZSH_CACHE_DIR/kubectl_completion" - - # TODO: 2022-01-05: remove this bit of code as it exists in oh-my-zsh.sh - # Add completions folder in $ZSH_CACHE_DIR - command mkdir -p "$ZSH_CACHE_DIR/completions" - (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file does not exist, generate it and then source it # Otherwise, source it and regenerate in the background if [[ ! -f "$ZSH_CACHE_DIR/completions/_kubectl" ]]; then diff --git a/plugins/rbw/rbw.plugin.zsh b/plugins/rbw/rbw.plugin.zsh index 523e35aff..b6cecf8b4 100644 --- a/plugins/rbw/rbw.plugin.zsh +++ b/plugins/rbw/rbw.plugin.zsh @@ -2,12 +2,6 @@ if (( ! $+commands[rbw] )); then return fi -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `rbw`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_rbw" ]]; then diff --git a/plugins/rust/rust.plugin.zsh b/plugins/rust/rust.plugin.zsh index db6ca9e74..858f14126 100644 --- a/plugins/rust/rust.plugin.zsh +++ b/plugins/rust/rust.plugin.zsh @@ -2,11 +2,6 @@ if ! (( $+commands[rustup] && $+commands[cargo] )); then return fi -# Add completions folder in $ZSH_CACHE_DIR -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `cargo`. Otherwise, compinit will have already done that if [[ ! -f "$ZSH_CACHE_DIR/completions/_cargo" ]]; then diff --git a/plugins/rustup/rustup.plugin.zsh b/plugins/rustup/rustup.plugin.zsh index 3d59c1c54..ef141cf8f 100644 --- a/plugins/rustup/rustup.plugin.zsh +++ b/plugins/rustup/rustup.plugin.zsh @@ -1,14 +1,6 @@ print ${(%):-'%F{yellow}The `rustup` plugin is deprecated and has been moved to the `rust` plugin.'} print ${(%):-'Please update your .zshrc to use the `%Brust%b` plugin instead.%f'} -# TODO: 2021-12-28: remove this block -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" -# Remove old generated completion file -command rm -f "${0:A:h}/_rustup" "$ZSH_CACHE_DIR/rustup_version" - (( ${fpath[(Ie)$ZSH/plugins/rust]} )) || { fpath=("$ZSH/plugins/rust" $fpath) source "$ZSH/plugins/rust/rust.plugin.zsh" diff --git a/plugins/volta/volta.plugin.zsh b/plugins/volta/volta.plugin.zsh index 79319394c..ab05ed5df 100644 --- a/plugins/volta/volta.plugin.zsh +++ b/plugins/volta/volta.plugin.zsh @@ -3,11 +3,6 @@ if (( ! $+commands[volta] )); then return fi -# TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh -# Add completions folder in $ZSH_CACHE_DIR -command mkdir -p "$ZSH_CACHE_DIR/completions" -(( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath) - # If the completion file doesn't exist yet, we need to autoload it and # bind it to `deno`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_volta" ]]; then -- cgit v1.2.3-70-g09d2