-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SURE-9155] Alignment of the sync behaviour of labels and annotations #1584
Comments
ProblemUpdating annotations on a cluster through the Rancher UI would not be reflected in the corresponding Fleet cluster resource, although propagation of updates did work for labels. SolutionAdded annotations to fields taken into account when creating a Fleet cluster object. TestingSee repro steps above Engineering TestingManual TestingTested reproduction steps before and after the change, noticing that in the latter case. Automated TestingAdded unit tests to Rancher covering cluster creation (which seems to be also run upon updating a cluster in the UI) and validating actual vs expected labels and annotations. QA Testing ConsiderationsVerify that update and deletion of labels through the UI works as expected, propagating changes to the corresponding Fleet cluster resource. Regressions ConsiderationsN/A |
QA ObservationsI have created a video which covers the detailed steps which I performed. In order to check the label/annotations on propagation from Fleet cluster to Management cluster. Also tried the API way and similar behavior observed VideosVideo showing detailed stepscluster-label-annotations.mp4 |
Apologies. I'd merged a fix into This issue and the PR linked there target Rancher v2.9.3. |
System Information
Scenario performed.
Video recorded but not able to rendered on GitHub. Note: Performed same steps which are available on this issue: #2937 (comment) |
Is there an existing issue for this?
Current Behavior
Currently it seems that only labels from the
v3/clusters
are synced to the correspondingfleet.cattle.io.clusters
object.Changes to the annotations are not synced.
This also causes changes to annotations via editing the cluster resource in the Rancher UI under
/dashboard/c/local/fleet/fleet.cattle.io.cluster
to only be reflected inv3/cluster
.Since this behaviour differs from the known behaviour of the labels, this leads to mistakes like those seen in Issue #1516.
Contrary to the assumption and changes made in the UI, no annotation has been configured on the fleet cluster object that could be referred to in the template.
Expected Behavior
As with labels, the user-defined annotations are synchronised from the
v3/clusters
object to the corresponding Fleet object.Steps To Reproduce
Create a cluster in Rancher
Edit the cluster in the UI under "Contionues Delivery" -> "Clusters" using "Edit Config".
Add labels and annotations and save the changes.
Using the browser's developer tools, it can be seen that two PUT requests have been made against
/v3/clusters/clusterid
andv1/fleet.cattle.io.clusters/fleet-default/clusterid
.The request against
/v3/clusters
contains the newly configured annotations and labels. The request against Fleet does not contain these.Display the Fleet Cluster Object, either via the UI as YAML (Download/Edit YAML) or via kubectl:
kubectl get clusters.fleet.cattle.io -n fleet-default -oyaml <clusterid>
The object only has the new labels, the annotations have not been added. Since the previous request did not add the labels to the fleet object directly, but they are now present, indicates that they are being synchronised from
v3/clusters
.Environment
Logs
No response
Anything else?
Workaround:
The cluster resource can be edited via "Edit Yaml".
In this case, the PUT request is only sent to
v1/fleet.cattle.io.clusters/fleet-default/clusterid
and this time also contains the labels and annotations.The text was updated successfully, but these errors were encountered: