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

ignoreDifferences and RespectIgnoreDifferences=true does allow ignoring differences in selected array elements

Open alexmt opened this issue 1 year ago • 4 comments

Checklist:

  • [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • [x] I've included steps to reproduce the bug.
  • [x] I've pasted the output of argocd version.

Describe the bug

Once https://github.com/argoproj/argo-cd/pull/17693 is merged Argo CD will be able to "ignore" arrays. However it is still not possible to ignore individual array elements. In order to fix it Argo CD would need to use strategic merge patch (using built-in k8s schema and dynamic CRD schema)

To Reproduce

Unit tests from https://github.com/argoproj/argo-cd/pull/14602 are reproducing behavior.

Expected behavior

It should be possible to ignore different individual array elements.

Version

v2.10.4

alexmt avatar Apr 02 '24 02:04 alexmt

Related to https://github.com/argoproj/argo-cd/issues/9678

alexmt avatar Apr 02 '24 02:04 alexmt

If someone attempts to fix it before me. We need to use strategic merge patch here: https://github.com/argoproj/argo-cd/pull/17693/files#diff-627c32a4f31d0f97e6ddc1f19ab3add7fb7791e0d1b0503d78c6c049e8cb4865R438

alexmt avatar Apr 02 '24 02:04 alexmt

Yes @alexmt I was attempting to fix it using strategic merge patch, it works well but only supports native k8s resources. Do you have any idea how it could work for custom resources?

saumeya avatar Apr 03 '24 12:04 saumeya

This issue is partially fixed by PR - https://github.com/argoproj/argo-cd/pull/17693#issuecomment-2035676032 , fix is only needed for custom resources now.

saumeya avatar Apr 25 '24 19:04 saumeya