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
It would be great to make it possible to add, set or remove cluster labels with an atomic API request.
Motivation
I operate number of cluster with personal operator, which calls ArgoCD API.
It sometimes need to add and remove cluster labels (changing where to roll or wipe ApplicationSet out).
There's PATCH method for Apps, but for Clusters, there's only PUT.
So, now my only way is to:
GET cluster, extract {labels}
Modify labels
PUT it back, sending modified {labels} dict using ?updatedFields=labels
Why it's not great:
It overwrites whole labels dict.
There's small but still a real chance that someone would edit labels between steps 1 and 3.
Thus, I would overwrite someone's data.
Make it possible to run PUT on /clusters in more precise way, e.g.:
PUT /api/v1/clusters/{id.value}?updatedFields=labels%5B%22example.org%2Ffoo%22%5D%2Clabels%5B%22example.org%2Fbar%22%5D
# This ugly value means:
# labels["example.org/foo"],labels["example.org/bar"]
The text was updated successfully, but these errors were encountered:
Summary
It would be great to make it possible to add, set or remove cluster labels with an atomic API request.
Motivation
I operate number of cluster with personal operator, which calls ArgoCD API.
It sometimes need to add and remove cluster labels (changing where to roll or wipe ApplicationSet out).
There's PATCH method for Apps, but for Clusters, there's only PUT.
So, now my only way is to:
{labels}
{labels}
dict using?updatedFields=labels
Why it's not great:
It overwrites whole
labels
dict.There's small but still a real chance that someone would edit labels between steps 1 and 3.
Thus, I would overwrite someone's data.
Proposal
I can think of three approaches here.
/clusters
in more precise way, e.g.:The text was updated successfully, but these errors were encountered: