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

Skip the inspecting state when inspection is disabled #1128

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

dtantsur
Copy link
Member

Currently, a host moves to the inspecting state and requests
a preprovisioning image even when inspection is disabled.

@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 31, 2022
@dtantsur
Copy link
Member Author

dtantsur commented Jun 2, 2022

/test-v1b1-centos-integration
/test-v1b1-ubuntu-integration

@elfosardo
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2022
Copy link
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

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

It occurs to me only just now that to solve the problem of registration requiring a PreprovisioningImage during inspection, all we really need to do is return early from this switch statement in the inspecting state if inspection is disabled.

Skipping the state altogether shouldn't hurt though.

docs/BaremetalHost_ProvisioningState.dot Outdated Show resolved Hide resolved
controllers/metal3.io/host_state_machine.go Show resolved Hide resolved
@metal3-io-bot metal3-io-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 10, 2022
Currently, a host moves to the inspecting state and requests
a preprovisioning image even when inspection is disabled.
@dtantsur
Copy link
Member Author

/test-v1b1-centos-integration
/test-v1b1-ubuntu-integration

@dtantsur dtantsur requested a review from zaneb June 14, 2022 15:49
@elfosardo
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2022
@zhouhao3
Copy link
Member

lgtm

@zaneb
Copy link
Member

zaneb commented Jun 21, 2022

#1137 implements my suggestion above, which solves the problem without the need to change the state machine.

@dtantsur
Copy link
Member Author

without the need to change the state machine.

I cannot agree it's a good thing. Starting inspection when it's disabled is confusing.

@zaneb
Copy link
Member

zaneb commented Jul 1, 2022

I found the original discussion where it was decided not to change the state machine: metal3-io/metal3-docs#155 (comment)
It doesn't appear to me that there was any compelling technical reason that we chose to do it that way.

switch {
case hsm.Host.NeedsHardwareInspection():
// TODO(dtantsur): move this logic inside NeedsHardwareInspection?
if hsm.Host.NeedsHardwareInspection() && !inspectionDisabled(hsm.Host) {
Copy link
Member

Choose a reason for hiding this comment

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

Moving it inside NeedsHardwareInspection would save updating the state machine diagram :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it was a bit more effort (needs to move some code around), are you fine with a follow-up?

@dtantsur
Copy link
Member Author

/test-centos-integration-main
/test-ubuntu-integration-main

@zaneb
Copy link
Member

zaneb commented Jul 13, 2022

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zaneb

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 Jul 13, 2022
@metal3-io-bot metal3-io-bot merged commit fa2b32e into metal3-io:main Jul 13, 2022
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. lgtm Indicates that a PR is ready to be merged. 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.

None yet

5 participants