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

Extend the argocd plugin by refresh and en/dis-abling of app sync #3142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Following is an example of some plugin files in this directory. Other files are
| Plugin-Name | Description | Available on Views | Shortcut | Kubectl plugin, external dependencies |
| ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------- |-----------| ------------------------------------------------------------------------------------- |
| ai-incident-investigation.yaml | Run AI investigation on application issues to find the root cause in seconds | all | Shift-h/o | [HolmesGPT](https://github.com/robusta-dev/holmesgpt) |
| 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) |
| get-all.yaml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) |
Expand Down
46 changes: 46 additions & 0 deletions plugins/argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,49 @@ plugins:
- $NAMESPACE
background: true
confirm: true

refresh-apps:
shortCut: Shift-R
confirm: false
scopes:
- apps
description: Refresh a argocd app hard
command: bash
background: false
args:
- -c
- "kubectl annotate applications -n argocd $NAME argocd.argoproj.io/refresh=hard"

disable-auto-sync:
shortCut: Shift-J
confirm: false
scopes:
- apps
description: Disable argocd sync
command: kubectl
background: false
args:
- patch
- applications
- -n
- argocd
- $NAME
- "--type=json"
- '-p=[{"op":"replace", "path": "/spec/syncPolicy", "value": {}}]'

enable-auto-sync:
shortCut: Shift-B
confirm: false
scopes:
- apps
description: Enable argocd sync
command: kubectl
background: false
args:
- patch
- applications
- -n
- argocd
- $NAME
- --type=merge
- '-p={"spec":{"syncPolicy":{"automated":{"prune":true,"selfHeal":true},"syncOptions":["ApplyOutOfSyncOnly=true","CreateNamespace=true","PruneLast=true","PrunePropagationPolicy=foreground"]}}}'