feat: add duplicate plugin (#3555)

mine
vash 2025-09-17 02:38:52 +03:00 committed by GitHub
parent 17fedc654c
commit 1c66a0a274
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 85 additions and 0 deletions

View File

@ -10,6 +10,7 @@ Following is an example of some plugin files in this directory. Other files are
| argocd.yaml | Perform argocd operation quickly | applications | Shift-r | [ArgoCD](https://argo-cd.readthedocs.io/en/stable/getting_started/) |
| debug-container.yaml | Add [ephemeral debug container](1)<br>([nicolaka/netshoot](2)) | containers | Shift-d | |
| dive.yaml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) |
| dup.yaml | Duplicate, edit and Debug resources | all | Shift-d/e/v | [dup](https://github.com/vash/dup) |
| external-secrets.yaml | Refresh external/push-secrets | externalsecrets/pushsecrets | Shift-R | |
| get-all.yaml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) |
| helm-diff.yaml | Diff with previous revision / current revision | helm/history | Shift-D/Q | [helm-diff](https://github.com/databus23/helm-diff) |

84
plugins/dup.yaml Normal file
View File

@ -0,0 +1,84 @@
plugins:
dup:
shortCut: Shift-D
description: Duplicate
scopes:
- all
command: bash
background: false
confirm: true
args:
- -c
- "kubectl dup -k $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_edit:
# Prompted to edit a new duplicate resource
shortCut: Shift-E
description: Duplicate + Edit
scopes:
- all
command: bash
background: false
confirm: true
args:
- -c
- "kubectl dup $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_pods:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- pods
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_deploy:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- deployments
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_sts:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- statefulsets
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_cronjob:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- cronjobs
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_jobs:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- jobs
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"