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
Currently it seems that only labels from the v3/clusters are synced to the corresponding fleet.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 in v3/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 and v1/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.
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:
Updating 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.
Solution
Added annotations to fields taken into account when creating a Fleet cluster object.
Testing
See repro steps above
Engineering Testing
Manual Testing
Tested reproduction steps before and after the change, noticing that in the latter case.
Automated Testing
Added 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 Considerations
Verify that update and deletion of labels through the UI works as expected, propagating changes to the corresponding Fleet cluster resource.
I 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
Videos
Video showing detailed stepscluster-label-annotations.mp4
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: