You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can jqPathExpressions be used in an Application definition .spec.ignoreDifferences[] for non-array matching and, if so, how?
(for those who require a proper background, please keep reading)
The setup:
I've got a central ArgoCD deployment that will manage other ArgoCD deployments in remote clusters (as a disaster-recovery of sorts).
Each remote ArgoCD has an Application definition in the central ArgoCD deployment.
Whenever a user of one of the remote ArgoCD is added, or changes password, the respective Application on the central ArgoCD gets OutOfSync.
For completeness, each remote ArgoCD also has a "self-managing" Application definition and the same behavior occurs in the user added / password change scenario.
The issue:
ArgoCD users are referenced in both the argocd-cm and in the argocd-secret with (and here is the source of the issue) different keys for each user: argocd/argocd-cm:
Taking advantage of the ignoreDifferences key and the RespectIgnoreDifferences=true directive, the Application definition (both on the central and remote ArgoCDs) is setup as (for the relevant parts):
This addresses the password change scenario, but not the user added one, since adding users will create additional keys that'll have to be added to the .spec.ignoreDifferences[].jsonPointers[] arrays.
Ignoring the whole content of the ConfigMap / Secret is not acceptable since there are other keys there that need to be managed.
The questions:
ignoreDifferences has another way of defining keys to be ignored, jqPathExpressions, which I've only found references of its use when arrays are in question in the YAML manifests.
Question 1: Can jqPathExpressions be used to avoid editing the Application definition each time a new user is added to ArgoCD?
I've tried several approaches myself to this without success (I'm not that familiar with JSON queries):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Good/morning/afternoon/evening.
TL;DR
Can
jqPathExpressions
be used in an Application definition.spec.ignoreDifferences[]
for non-array matching and, if so, how?(for those who require a proper background, please keep reading)
The setup:
The issue:
argocd-cm
and in theargocd-secret
with (and here is the source of the issue) different keys for each user:argocd/argocd-cm
:argocd/argocd-cm
:The workaround:
.spec.ignoreDifferences[].jsonPointers[]
arrays.The questions:
ignoreDifferences
has another way of defining keys to be ignored,jqPathExpressions
, which I've only found references of its use when arrays are in question in the YAML manifests.Question 1: Can
jqPathExpressions
be used to avoid editing the Application definition each time a new user is added to ArgoCD?.data |with_entries(select(.key |startswith("accounts.")))
.data |to_entries[] |select(.key |startswith("accounts.")) |.key
.data |to_entries |map(select(.key |startswith("accounts."))) |from_entries
.data |to_entries |map(select(.key |startswith("accounts."))) |map(".data." + .key)
Question 2: If the answer to Question 1 is positive, what should be the expected input to
jqPathExpressions
?Thank you very much for reading so far.
Beta Was this translation helpful? Give feedback.
All reactions