Skip to content

Commit

Permalink
Disable pruning for automated sync of root apps
Browse files Browse the repository at this point in the history
This ensures that we can move component instances between different root
apps without having to manually disable auto-sync for the root apps on
all clusters that use the component.
  • Loading branch information
simu committed Dec 23, 2024
1 parent 849b95d commit ceb8974
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions component/app.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ local root_app(team) =
else
'manifests/apps-%s/' % team,
},
syncPolicy+: {
automated+: {
// don't prune resources managed by root app so we don't accidentally
// delete apps when moving them between root apps
prune: false,
},
},
},
};

Expand Down
2 changes: 1 addition & 1 deletion tests/golden/defaults/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
targetRevision: HEAD
syncPolicy:
automated:
prune: true
prune: false
selfHeal: true
2 changes: 1 addition & 1 deletion tests/golden/https-catalog/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
targetRevision: HEAD
syncPolicy:
automated:
prune: true
prune: false
selfHeal: true
2 changes: 1 addition & 1 deletion tests/golden/openshift/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
targetRevision: HEAD
syncPolicy:
automated:
prune: true
prune: false
selfHeal: true
2 changes: 1 addition & 1 deletion tests/golden/params/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
targetRevision: HEAD
syncPolicy:
automated:
prune: true
prune: false
selfHeal: true
2 changes: 1 addition & 1 deletion tests/golden/prometheus/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ spec:
targetRevision: HEAD
syncPolicy:
automated:
prune: true
prune: false
selfHeal: true

0 comments on commit ceb8974

Please sign in to comment.