Skip to content

Conversation

@s3rj1k
Copy link
Member

@s3rj1k s3rj1k commented Oct 28, 2025

@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 28, 2025
@metal3-io-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@metal3-io-bot metal3-io-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 28, 2025
@s3rj1k s3rj1k force-pushed the fromPoolAnnotation branch 2 times, most recently from d39b1d2 to 6a56bce Compare October 28, 2025 17:42
@metal3-io-bot metal3-io-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 28, 2025
@s3rj1k s3rj1k force-pushed the fromPoolAnnotation branch 5 times, most recently from fddb510 to 45a3075 Compare October 29, 2025 20:49
@s3rj1k s3rj1k marked this pull request as ready for review October 29, 2025 21:57
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 29, 2025
Copy link
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @s3rj1k. Overall lgtm.

One minor comment. There's some core logic changes in the PR, such as the addFromAnnotation and getReferencedPools functions (which handle the extraction and processing of pool references from annotations at a lower level), do not appear to have direct unit test coverage in this PR. Would you please add a few more unit tests to cover those changes?

@s3rj1k s3rj1k force-pushed the fromPoolAnnotation branch from 45a3075 to ff5964a Compare November 3, 2025 18:40
@metal3-io-bot metal3-io-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 3, 2025
@s3rj1k
Copy link
Member Author

s3rj1k commented Nov 3, 2025

Thanks a lot @s3rj1k. Overall lgtm.

One minor comment. There's some core logic changes in the PR, such as the addFromAnnotation and getReferencedPools functions (which handle the extraction and processing of pool references from annotations at a lower level), do not appear to have direct unit test coverage in this PR. Would you please add a few more unit tests to cover those changes?

Thanks for review, hopefully this will handle requested changes

@Rozzii
Copy link
Member

Rozzii commented Nov 4, 2025

I feel we need everyone to check this, quite a big change
@adilGhaffarDev @zaneb @fmuyassarov @Rozzii

@kashifest
Copy link
Member

Thanks for review, hopefully this will handle requested changes

Thank you.
/approve

/hold
Since  @Rozzii asked more eyes on this PR, holding it for some time.

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2025
@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2025
@kashifest
Copy link
Member

/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main

@s3rj1k
Copy link
Member Author

s3rj1k commented Nov 5, 2025

/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main

Success!

// a Machine, Metal3Machine, or BareMetalHost object.
// When set, FromIPPool and FromPoolRef are ignored.
// +optional
FromPoolAnnotation *FromPoolAnnotation `json:"fromPoolAnnotation,omitempty"`
Copy link
Member

@adilGhaffarDev adilGhaffarDev Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we allowing this to be set on any of the object?
why not just one, maybe just m3m?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few points:

  • github.com/Add fromPoolAnnotation field for IPPool reference via annotation metal3-docs#571 this was explicitly showing a usecase where you would use BMH
  • CAPM3 has other fromAnnotation features and they support all 3 objects
  • as a consumer I want to have flexibility on what object I put this annotations, I don't want to be gated out on features
  • as a consumer I create BMH, not m3m, I want all configs be in object that I create and don't want to be forced to ad-hoc update some ohter object that gets created during life-cycle of the cluster

What is the real concern here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right it works the same way for other fromAnnotation features. But since you’re not introducing that change, lgtm from my side on this PR.
In my opinion probably just bmh is fine, my concern is with the getValueFromAnnotation function, it currently prioritizes m3m and ignores other annotations. I dont think this is documented properly. I will check that.
/lgtm
cc @lentzi90 please check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/metal3-io/cluster-api-provider-metal3/blob/main/baremetal/metal3data_manager.go#L1460

I am guessing that idea was something like, if we have some specific annotation managed in CAPM3 in future we would put that annotation on m3machine and let's ensure that this is what will be used, this kind of makes sense and I agree this should be documented if not already.

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 6, 2025
Copy link
Member

@Sunnatillo Sunnatillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Great work @s3rj1k. Thank you.

Is it possible for you to add documentation about how to use this feature in metal3 book?

@s3rj1k
Copy link
Member Author

s3rj1k commented Nov 19, 2025

Is it possible for you to add documentation about how to use this feature in metal3 book?

We already have this metal3-io/metal3-docs@e6c0eac

Just needs to be updated, remove development part.
Maybe feature preview or something similar?

@s3rj1k
Copy link
Member Author

s3rj1k commented Nov 26, 2025

@kashifest @Rozzii are we ready to land this?

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants