diff --git a/internal/controller/metal3.io/host_state_machine.go b/internal/controller/metal3.io/host_state_machine.go index fc76a218d0..7264afb9b1 100644 --- a/internal/controller/metal3.io/host_state_machine.go +++ b/internal/controller/metal3.io/host_state_machine.go @@ -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: