Skip to content
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

Alignment of the sync behaviour of labels and annotations #1584

Open
1 task done
drasang opened this issue Jun 9, 2023 · 2 comments
Open
1 task done

Alignment of the sync behaviour of labels and annotations #1584

drasang opened this issue Jun 9, 2023 · 2 comments
Assignees
Labels
Milestone

Comments

@drasang
Copy link

drasang commented Jun 9, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

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.

Environment

* Architecture: amd64
* Fleet Version: 0.6.0
* Rancher Version: 2.7.4
* Management Cluster: 
  * Provider: EKS
  * Version: 1.24
* Downstream Cluster: 
  * Provider: EKS (Imported)
  * Kubernetes Version: 1.23/1.24

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.

@weyfonk
Copy link
Contributor

weyfonk commented Oct 1, 2024

Problem

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.

Regressions Considerations

N/A

@sbulage
Copy link
Contributor

sbulage commented Oct 4, 2024

QA Observations

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 steps
cluster-label-annotations.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs QA review
Development

No branches or pull requests

6 participants