argo-cd icon indicating copy to clipboard operation
argo-cd copied to clipboard

Support managedFieldManagers in AppSet ignoreApplicationDifferences

Open gnunn1 opened this issue 1 year ago • 1 comments

Summary

The ApplicationSet has the ability to ignore targetted differences to the Application via ignoreApplicationDifferences. However unlike the Application or Global ignoreDifferences it does not support using this for managedFieldManagers.

Motivation

In the app-of-app pattern I use ignoreDifferences with the managedFieldManager set to argocd-server, this enables me to temporarily override selfHeal from the UI when I need to troubleshoot applications as per this example:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: cluster-config-bootstrap
  namespace: openshift-gitops
  labels:
    gitops.ownedBy: cluster-config
spec:
  ...
  syncPolicy:
    automated:
      prune: false
      selfHeal: false
  ignoreDifferences:
    - group: argoproj.io
      kind: Application
      managedFieldsManagers:
        - argocd-server
      jsonPointers:
        - /spec/syncPolicy/automated

Proposal

I'm not deep enough into the code base to outline an implementation proposal but ideally ignoreApplicationDifferences could simply reuse the implementation already available in Argo CD. The managedFieldManagers would simply be an additional field parallel to the existing fields like jsonPointers, jqPathExpressions and name.

gnunn1 avatar Oct 15 '24 16:10 gnunn1

tbh I skipped managedFieldsManagers in ignoreApplicationDifferences just for convenience. The other two options covered the use cases I cared about. I'm not aware of any particularly difficult challenges related to adding managedFieldsManagers support.

crenshaw-dev avatar Oct 15 '24 17:10 crenshaw-dev