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
We have ArgoCD ApplicationSet that is managing CRD objects on target clusters.
For some of the CRD objects, target cluster owner want to have their own values and not managed via ArgoCD.
So for example we have 200 objects and 5 of them have annotation managed.by: self-service on set of specific target clusters.
This jqPathExpression produces wrong output if (.metadata.annotations["managed.by"] == "self-service") then .spec.custom_field else null end because result of this is value of .spec.custom_field, which is incorrect for jq
I've tried changing it to if (.metadata.annotations["managed.by"] == "self-service") then ".spec.custom_field" else null end
The difference is ".spec.custom_field", which means it should return this as path, which doesn't fail, but result is strange.
Result is that:
It doesn't delete annotation - success
It doesn't delete existing value in .spec.custom_field of CRD object - success
It adds what in repository on top of .spec.custom_field in CRD objects - WRONG
Expectations are that it won't add/remove anything in .spec.custom_field.
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
-
We have ArgoCD ApplicationSet that is managing CRD objects on target clusters.
For some of the CRD objects, target cluster owner want to have their own values and not managed via ArgoCD.
So for example we have 200 objects and 5 of them have annotation
managed.by: self-service
on set of specific target clusters.Here is out part of our AppSet manifest:
There are few issues with this solution:
jqPathExpression
produces wrong outputif (.metadata.annotations["managed.by"] == "self-service") then .spec.custom_field else null end
because result of this is value of.spec.custom_field
, which is incorrect forjq
I've tried changing it to
if (.metadata.annotations["managed.by"] == "self-service") then ".spec.custom_field" else null end
The difference is ".spec.custom_field", which means it should return this as path, which doesn't fail, but result is strange.
Result is that:
.spec.custom_field
of CRD object - success.spec.custom_field
in CRD objects - WRONGExpectations are that it won't add/remove anything in
.spec.custom_field
.I did add annotations:
But object is still shown in
diff
and app is out of sync.What would be best way to do this properly to get set of objects ignored based on annotation value?
Thanks,
Vasyl
Beta Was this translation helpful? Give feedback.
All reactions