Search code examples
kubernetesjsonpathargocdlinkerdjsonpointer

Fixing out of sync warning in Argo CD - Unable to ignore the optional `preserveUnknownFields` field


Argo CD shows two items from linkerd (installed by Helm) are being out of sync. The warnings are caused by the optional preserveUnknownFields: false in the spec section:

trafficsplits.split.smi-spec.io enter image description here

enter image description here

serviceprofiles.linkerd.io

enter image description here

enter image description here

But I'm not able to figure out how to ignore the difference using ignoreDifferences in the Application manifest. The /spec/preserveUnknownFields json path isn't working. Is it because the field preserveUnknownFields is not present in the left version?


apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: linkerd
  namespace: argocd
spec:
  destination:
    namespace: linkerd
    server: https://kubernetes.default.svc
  project: default
  source:
    chart: linkerd2
    repoURL: https://helm.linkerd.io/stable
    targetRevision: 2.10.1
 syncPolicy:
    automated: {}
  ignoreDifferences:
     - group: apiextensions.k8s.io/v1
       name: trafficsplits.split.smi-spec.io
       kind: CustomResourceDefinition
       jsonPointers:
         - /spec/preserveUnknownFields
     - group: apiextensions.k8s.io/v1
       name: trafficsplits.split.smi-spec.io
       kind: CustomResourceDefinition
       jsonPointers:
         - /spec/preserveUnknownFields

Solution

  • As per documentation, I think you have to use apiextensions.k8s.io not apiextensions.k8s.io/v1.