-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
Summary
Have a way to disable a sync with replace, the one that users check in the UI. It shouldn't affect replace for large CRDs, which isn't sometimes done if regular sync fails.
Motivation
Allow to configure sync with replace to not happen, e.g. relevant for resources which are owning pods like Deployment, Rollout. Replacing those can cause replica count to drop to 1 and cause issues. In practice, people ignore the warnings about Replace being dangerous too much. And sync with force can solve most problems that sync with replace might be used for.
Proposal
Have an option in argocd-cmd-params-cm like server.sync.replace.allowed, which if false, fails attempts to sync with replace. The users would still see the replace checkbox and can click it, however they'd get an error saying the option was disabled by configuration. This way they can know it exists and might be able to negotiate with administrators if they really need it. If there's an annotation of resources or some big CRD needs to be replaced, that would still happen, i.e. the option would only not allow using the checkbox for Replace.
Historically, multiple proposals have been considered, including RBAC-based one and annotations/options to disable sync with replace in a more granular way, but they were found to be have disadvantages and were ultimately rejected.