Skip to content

Commit 39eef03

Browse files
Extend the argocd plugin by refresh and en/dis-abling of app sync (#3142)
* Extend the argocd plugin by refresh and en/dis-abling of app sync * Add argocd plugin to plugins readme --------- Co-authored-by: Lorenz Boguhn <Lorenz.Boguhn@ppi.de>
1 parent 74ff6d4 commit 39eef03

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

plugins/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Following is an example of some plugin files in this directory. Other files are
77
| Plugin-Name | Description | Available on Views | Shortcut | Kubectl plugin, external dependencies |
88
| ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------- |-----------| ------------------------------------------------------------------------------------- |
99
| 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) |
10+
| argocd.yaml | Perform argocd operation quickly | applications | Shift-r | [ArgoCD](https://argo-cd.readthedocs.io/en/stable/getting_started/) |
1011
| debug-container.yaml | Add [ephemeral debug container](1)<br>([nicolaka/netshoot](2)) | containers | Shift-d | |
1112
| dive.yaml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) |
1213
| external-secrets.yaml | Refresh external/push-secrets | externalsecrets/pushsecrets | Shift-R | |

plugins/argocd.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,49 @@ plugins:
1313
- $NAMESPACE
1414
background: true
1515
confirm: true
16+
17+
refresh-apps:
18+
shortCut: Shift-R
19+
confirm: false
20+
scopes:
21+
- apps
22+
description: Refresh a argocd app hard
23+
command: bash
24+
background: false
25+
args:
26+
- -c
27+
- "kubectl annotate applications -n argocd $NAME argocd.argoproj.io/refresh=hard"
28+
29+
disable-auto-sync:
30+
shortCut: Shift-J
31+
confirm: false
32+
scopes:
33+
- apps
34+
description: Disable argocd sync
35+
command: kubectl
36+
background: false
37+
args:
38+
- patch
39+
- applications
40+
- -n
41+
- argocd
42+
- $NAME
43+
- "--type=json"
44+
- '-p=[{"op":"replace", "path": "/spec/syncPolicy", "value": {}}]'
45+
46+
enable-auto-sync:
47+
shortCut: Shift-B
48+
confirm: false
49+
scopes:
50+
- apps
51+
description: Enable argocd sync
52+
command: kubectl
53+
background: false
54+
args:
55+
- patch
56+
- applications
57+
- -n
58+
- argocd
59+
- $NAME
60+
- --type=merge
61+
- '-p={"spec":{"syncPolicy":{"automated":{"prune":true,"selfHeal":true},"syncOptions":["ApplyOutOfSyncOnly=true","CreateNamespace=true","PruneLast=true","PrunePropagationPolicy=foreground"]}}}'

0 commit comments

Comments
 (0)