Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions internal/controller/metal3.io/host_state_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,19 +358,10 @@ func (hsm *hostStateMachine) ensureRegistered(info *reconcileInfo) (result actio
// In the deleting state the whole idea is to de-register the host
return result
case metal3api.StateRegistering:
case metal3api.StateInspecting, metal3api.StatePreparing:
// The Infrastructure operator in RHACM <=2.4 does not supply a
// controller for PreprovisioningImages with an InfraEnv label, (which
// the default controller ignores) but an image will be required
// if we register in the Preparing state. We know that this version
// never has work to do in Preparing, so it is safe to disable
// registration in that state. In later versions, where the controller
// is available and we need images, inspection will not be disabled.
if _, hasInfraEnv := hsm.Host.Labels["infraenvs.agent-install.openshift.io"]; hsm.NextState == metal3api.StateInspecting || hasInfraEnv {
if hsm.Host.InspectionDisabled() {
// No need to register if we are not actually going to inspect
return
}
case metal3api.StateInspecting:
if hsm.Host.InspectionDisabled() {
// No need to register if we are not actually going to inspect
return
}
fallthrough
default:
Expand Down