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

[release-1.9] ✨ Sync machine annotations to nodes #11980

Open
wants to merge 1 commit into
base: release-1.9
Choose a base branch
from

Conversation

nrb
Copy link
Contributor

@nrb nrb commented Mar 17, 2025

What this PR does / why we need it:

Introduces propagation of a Machine's annotations to the relevant Node (backport of #11813 since it doesn't cherry-pick cleanly).

There is new functionality introduced by default with this PR, which may not be desirable for a backport. Specifically, any annotations on a Machine using the node.cluster.x-k8s.io domain prefix will be synced to the corresponding Node. This did not happen prior to this code change, and could be surprising. We had a brief Slack conversation about this, but I figure a PR offers a more durable/searchable place for the conversation and decision.

Support for propagating arbitrary annotations through the --additional-sync-machine-annotations argument is possible, but this is not enabled by default, and thus should not pose any surprises to users.

/area machine

* Sync machine annotattions to nodes

Signed-off-by: Nolan Brubaker <[email protected]>

* Plumb manager argument through to controller

Signed-off-by: Nolan Brubaker <[email protected]>

* Manage annotations from previous reconciles

Signed-off-by: Nolan Brubaker <[email protected]>

* Add e2e test and refactor filtering

Signed-off-by: Nolan Brubaker <[email protected]>

* Documents new annotations

This change documents the new cluster.x-k8s.io/labels-from-machine and
cluster.x-k8s.io/annotations-from-machine annotations.

* refactor: drop getManaged{Labels, Annotations} wrappers

This refactors reconcileNode to remove the getManagedLabels and
getManagedAnnotations wrapper functions, in favour of calling the
libraries directly.

* Moves Tests GetManagedLabels,GetManagedAnnotations

This moves the tests for GetManagedLabels and GetManagedAnnotations to
their respective util packages, as that's where they're now implemented.

* Don't add known CAPI annotatoins to annotations-from-machine

Signed-off-by: Nolan Brubaker <[email protected]>

* Reduce length of annotation to fix tests

Signed-off-by: Nolan Brubaker <[email protected]>

* Add more details about a use case

Signed-off-by: Nolan Brubaker <[email protected]>

* Address review feedback

Signed-off-by: Nolan Brubaker <[email protected]>

* Apply suggestions from code review

Co-authored-by: Stefan Büringer <[email protected]>
Signed-off-by: Nolan Brubaker <[email protected]>

* Additional review feedback

Signed-off-by: Nolan Brubaker <[email protected]>

---------

Signed-off-by: Nolan Brubaker <[email protected]>
Co-authored-by: Theo Barber-Bany <[email protected]>
Co-authored-by: Stefan Büringer <[email protected]>
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Mar 17, 2025
@k8s-ci-robot k8s-ci-robot added area/machine Issues or PRs related to machine lifecycle management cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 17, 2025
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 17, 2025
@nrb
Copy link
Contributor Author

nrb commented Mar 17, 2025

Note: we can discuss at the community call on March 19, 2025. I understand a patch release is coming on March 18, but this is not urgent for that patch.

@nrb
Copy link
Contributor Author

nrb commented Mar 17, 2025

/hold
until community call

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2025
@sbueringer
Copy link
Member

Thx

/lgtm
/test pull-cluster-api-e2e-release-1-9

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1b7684f4e98acaf18ff37531b5e508992083285b

@sbueringer
Copy link
Member

sbueringer commented Mar 18, 2025

Test failure probably due to kind image rate limiting (currently a known issue). We can retest once we want to merge the PR

@chrischdi
Copy link
Member

/retest

Situation propably is better now.

@chrischdi
Copy link
Member

/lgtm

I'm good with the backport 👍

@nrb
Copy link
Contributor Author

nrb commented Mar 19, 2025

Discussed at the 19 March community meeting - we'll put lazy consensus on this. If there are no objections by Friday, 20 March we can unhold this and merge for the next 1.9 patch release.

@sbueringer
Copy link
Member

/approve

(keeping the hold for Friday)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/machine Issues or PRs related to machine lifecycle management cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants