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

improve: sync script to detect if prune required before syncing #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thesuperzapper
Copy link
Member

@thesuperzapper thesuperzapper commented Feb 14, 2024

This PR improves the sync_argocd_apps.sh script so that it detects if resources need to be pruned before syncing, rather than doing a sync, and seeing if it throws a warning that resources require pruning.

We do this by additionally checking if there are any resources with requiresPruning: true when we get the status of the ArgoCD apps, and only prompting the user to prune there if there is at least one. We also print the list of resources that need to be pruned, to help the user decide.


WARNING: DO NOT MERGE until argoproj/argo-cd#17188 is resolved

Note, we could work-around the upstream ArgoCD issue by looping over each resource that "requires pruning", and check if it has the argocd.argoproj.io/sync-options: Prune=false annotation.

However, this approach has two significant problems:

  • It requires that the person running the sync script has a kubectl context with permission to get on pretty much every resource in the cluster.
  • It will require potentially hundreds of get requests, one for each resource that ArgoCD thinks needs to be pruned (which will increase for some deployKF apps with the number of users, as we replicate resources like Secrets for each profile).

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
@thesuperzapper thesuperzapper added the status/do-not-merge status - something is blocking this label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/improve status/do-not-merge status - something is blocking this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant