argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.85k stars 5.45k forks source link

Support managedFieldManagers in AppSet ignoreApplicationDifferences #20385

Open gnunn1 opened 3 weeks ago

gnunn1 commented 3 weeks ago

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.

crenshaw-dev commented 3 weeks ago

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.