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

[SURE-9155] Alignment of the sync behaviour of labels and annotations #1584

Closed
1 task done
drasang opened this issue Jun 9, 2023 · 4 comments
Closed
1 task done
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.

@rancherbot rancherbot added this to Fleet Jun 9, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Fleet Jun 9, 2023
@manno manno added this to the 2023-Q4-v2.8x milestone Jul 26, 2023
@manno manno moved this from 🆕 New to 📋 Backlog in Fleet Aug 2, 2023
@kkaempf kkaempf modified the milestones: v2.8.0, 2024-Q1-2.8x Sep 27, 2023
@manno manno modified the milestones: 2024-Q1-2.8x, v2.9.0 Nov 27, 2023
@manno manno moved this from 📋 Backlog to To Triage in Fleet Mar 13, 2024
@manno manno modified the milestones: v2.9.0, v2.9-Next1 Mar 13, 2024
@manno manno moved this from To Triage to 📋 Backlog in Fleet Jul 3, 2024
@kkaempf kkaempf modified the milestones: v2.9-Next1, v2.9-Next2 Aug 8, 2024
@weyfonk weyfonk self-assigned this Sep 6, 2024
@weyfonk weyfonk moved this from 📋 Backlog to 🏗 In progress in Fleet Sep 6, 2024
@olblak olblak modified the milestones: v2.9.2, v2.9-Next1 Sep 11, 2024
@weyfonk weyfonk moved this from 🏗 In progress to 👀 In review in Fleet Sep 16, 2024
@weyfonk weyfonk moved this from 👀 In review to Needs QA review in Fleet Oct 1, 2024
@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

@sbulage sbulage moved this from Needs QA review to 🏗 In progress in Fleet Oct 7, 2024
@weyfonk weyfonk modified the milestones: v2.9.3, v2.10.0 Oct 7, 2024
@weyfonk
Copy link
Contributor

weyfonk commented Oct 7, 2024

Apologies. I'd merged a fix into rancher/rancher's main, ie targetting Rancher v2.10.0 instead of v2.9.3 which was the original target milestone for this issue.
Please validate this against v2.10.0.

This issue and the PR linked there target Rancher v2.9.3.

@weyfonk weyfonk moved this from 🏗 In progress to Needs QA review in Fleet Oct 9, 2024
@p-se p-se changed the title Alignment of the sync behaviour of labels and annotations [SURE-9155] Alignment of the sync behaviour of labels and annotations Oct 9, 2024
@p-se p-se added the JIRA Must shout label Oct 9, 2024
@sbulage
Copy link
Contributor

sbulage commented Oct 31, 2024

System Information

Rancher Version Fleet Version
v2.10.0-alpha5 fleet:v0.11.0-beta.3

Scenario performed.

  • Labels and annotations are updated from Continuous Delivery --> Clusters are updated to the Management clusters and vice-versa
  • Same procedure performed via API PUT method and it did worked.
  • Labels and Annotations updated via API endpoints are reflected on same cluster under Fleet Clusters and Management clusters.

Video recorded but not able to rendered on GitHub.

Note: Performed same steps which are available on this issue: #2937 (comment)

@sbulage sbulage closed this as completed Oct 31, 2024
@github-project-automation github-project-automation bot moved this from Needs QA review to ✅ Done in Fleet Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

7 participants