Open lindhe opened 3 months ago
Seeing the same with my argo deployment of trident-operator. I suspect k8s considers priority 0 as redundant and mutates it out.
Current workaround with ArgoCD is to utilize the ignoreDifferences
feature of the Application: (https://argo-cd.readthedocs.io/en/stable/user-guide/diffing/)
We've just bumped into this as well. In case someone finds it useful, here's our change to Application/trident to address this:
--- all.yaml 2024-08-06 10:11:43.216415082 +0200
+++ all.new.yaml 2024-08-06 10:09:10.890141528 +0200
@@ -855,22 +855,29 @@
helm:
valueFiles:
- values.yaml
- values.eu-dev.yaml
destination:
server: "https://kubernetes.default.svc"
namespace: trident
+ ignoreDifferences:
+ - group: apiextensions.k8s.io
+ jqPathExpressions:
+ - .spec.versions[]? | .additionalPrinterColumns[]? | .priority
+ kind: CustomResourceDefinition
+ name: tridentconfigurators.trident.netapp.io
syncPolicy:
automated:
selfHeal: true
prune: true
syncOptions:
- CreateNamespace=true
+ - RespectIgnoreDifferences=true
retry:
limit: 10000000
backoff:
# the amount to back off. Default unit is seconds,
# but could also be a duration (e.g. "2m", "1h")
duration: 30s
# a factor to multiply the base duration after each failed retry
factor: 2
Describe the bug
I just upgraded from Helm chart version 100.2402.0 to 100.2406.1. After the upgrade, I noticed that Argo CD still had a diff between desired state and live state, and it never goes away:
In the new CRD
TridentConfigurator
, there is a listadditionalPrinterColumns
where objects may set the fieldpriority
. Some elements in the list haspriority: 0
according to the CRD applied by the Helm chart:https://github.com/NetApp/trident/blob/722e7ef9e58b56fa5815af10c8794b0097ac8b9c/helm/trident-operator/crds/tridentconfigurators.yaml#L17-L42
It seems like they get modified, I'm guessing by the Trident operator, so the
priority
field gets removed if its value is0
. This causes a constant diff in tools like Argo CD. In the particular case of Argo CD, it is possible to ignore changes to certain object attributes, but I think this diff is probably unintentional and should be fixed.Environment Provide accurate information about the environment to help us reproduce the issue.
helm template --include-crds trident -n trident trident/trident-operator --set 'tridentLogFormat=json' --version 100.2406.1
(this is similar to what Argo CD with Kustomize executes in my case)To Reproduce
kubectl get crd TridentConfigurator -o yaml
and see thatpriority: 0
is unset.Expected behavior
There should be no diff after apply.
Additional context
If I sync Argo CD so the
priority
field gets set, thetrident-operator
produces this log: trident-operator.log