argoproj / argo-cd

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

Support ignoreDifferences within string #20873

Open DerekTBrown opened 4 days ago

DerekTBrown commented 4 days ago

Summary

Motivation

For example- there are certain fields within our Kiali ConfigMap that show diffs on every update. We would like to suppress those changes in the ArgoCD UI.

Proposal

type ResourceIgnoreDifferences struct {
     ...
     JSONPointers           []string `json:"jsonPointers,omitempty" protobuf:"bytes,5,opt,name=jsonPointers"`
     JQPathExpressions      []string `json:"jqPathExpressions,omitempty" protobuf:"bytes,6,opt,name=jqPathExpressions"`
+   YAMLStringIgnoreJQPaths []string `json:"yamlStringIgnoreJQPaths,omitempty" protobuf:"bytes,6,opt,name=yamlStringIgnoreJQPaths"`

The behavior would be:

andrii-korotkov-verkada commented 4 days ago

Hm, this seems like it would be inconsistent with how JSONPointers and JQPathExpressions behave currently.

andrii-korotkov-verkada commented 4 days ago

I don't fully understand the motivation yet. Wouldn't setting ignoreDifferences on individual keys in the data section work?