Skip to content

Conversation

@nerok
Copy link
Contributor

@nerok nerok commented Aug 21, 2025

What this PR does / why we need it:
Add a validation for live-iso to require a bmc protocol (that is the part in the address before "://") which includes "virtualmedia", which seems to be what the requirement for live-isos are according to the docs: https://book.metal3.io/bmo/live-iso

This relates to #855

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign elfosardo for approval. For more information see the Code Review Process.

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

Details 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
Copy link
Contributor

Hi @nerok. Thanks for your PR.

I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@metal3-io-bot metal3-io-bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 21, 2025
@tuminoid
Copy link
Member

/ok-to-test

@metal3-io-bot metal3-io-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 22, 2025
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Some minor comments left.

if image != nil &&
image.DiskFormat != nil &&
*image.DiskFormat == "live-iso" &&
!strings.Contains(strings.Split(bmcAddress, "://")[0], "virtualmedia") {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use something like hasPrefix("redfish-virtualmedia://") , seems more robust?

Copy link
Contributor Author

@nerok nerok Aug 22, 2025

Choose a reason for hiding this comment

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

Do we have a list somewhere over prefixes? because I found these in the docs:

  • redfish-virtualmedia://
  • idrac-virtualmedia://
  • ilo5-virtualmedia://
  • ilo4-virtualmedia://

and all of there can also have +http or +https.
I can probably use hasPrefix instead yeah

Copy link
Member

Choose a reason for hiding this comment

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

If you can make it work cleanly, sure, but if it gets complicated, then the current one is fine as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think another look at this improved it a lot.
Still got the "contains", but I believe the right way there would be to add SupportsVirtualmedia() to the BMCs, and call those.
I could give that a go, but it is a bit outside of the scope of this PR, and I'm uncertain if we would actually need it anywhere else.

Copy link
Member

Choose a reason for hiding this comment

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

I'm good with this iteration.

@nerok nerok force-pushed the validation_tests branch from bd5c79c to 33cb3ba Compare August 22, 2025 15:35
@metal3-io-bot metal3-io-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 22, 2025
Copy link
Member

@tuminoid tuminoid left a comment

Choose a reason for hiding this comment

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

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2025
errs = append(errs, fmt.Errorf("BMC driver %s does not support secure boot", bmcAccess.Type()))
}

if s.Image != nil && s.Image.DiskFormat != nil && *s.Image.DiskFormat == "live-iso" && !strings.Contains(bmcAccess.Type(), "virtualmedia") {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it's safe to make this assumption about the driver name.

I would expect that in practice bmcAccess.SupportsISOPreprovisioningImage() corresponds to exactly what we want to know. @dtantsur can you confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That worked locally atleast, pushed it up in a new version

Copy link
Member

Choose a reason for hiding this comment

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

@zaneb @dtantsur can you check if you're happy with latest version?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

/lgtm
The one where this gives a different answer is the UEFI HTTP driver, but I am not good enough at tracing the code through ironic to say one way or the other there whether live-iso should be allowed there. (If I had to guess though, I'd say yes and that this version is correct.)

Signed-off-by: Didrik Frimann Barroso Koren <[email protected]>
@nerok nerok force-pushed the validation_tests branch from 33cb3ba to 0384268 Compare August 26, 2025 12:45
@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 26, 2025
@metal3-io-bot metal3-io-bot requested a review from zaneb September 3, 2025 06:45
@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2025
errs = append(errs, fmt.Errorf("BMC driver %s does not support secure boot", bmcAccess.Type()))
}

if s.Image != nil && s.Image.DiskFormat != nil && *s.Image.DiskFormat == "live-iso" && !bmcAccess.SupportsISOPreprovisioningImage() {
Copy link
Member

Choose a reason for hiding this comment

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

We tried this, and people complained. The thing is: technically you can boot an ISO over iPXE. It does not work with all ISO's, but apparently does work with some.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Am I understanding you correct in that we shouldn't have this validation at all? Or is there a part of this validation that could be valuable? If not we should ensure it is documented, and I would think a test would be nice to ensure we don't break anything at a later point?

@metal3-io-bot metal3-io-bot added the needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2025
@metal3-io-bot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates that a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants