Skip to content

Commit

Permalink
Support ControlPlaneCreationError on baremetal
Browse files Browse the repository at this point in the history
Wraps control plane provisioning errors on baremetal IPI with the
ControlPlaneCreationError so that gather bootstrap will run
automatically in that case.
  • Loading branch information
patrickdillon committed Oct 25, 2024
1 parent a0960a3 commit ff9a521
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/utils/baremetal/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"k8s.io/client-go/rest"
clientwatch "k8s.io/client-go/tools/watch"

"github.com/openshift/installer/pkg/asset"
"github.com/openshift/installer/pkg/infrastructure/baremetal"
)

Expand Down Expand Up @@ -106,5 +107,9 @@ func WaitForBaremetalBootstrapControlPlane(ctx context.Context, config *rest.Con
return fmt.Errorf("failed to persist masters file to disk: %w", err)
}

return withSyncErr
if withSyncErr != nil {
// wrap with ControlPlaneCreationError to trigger bootstrap log bundle gather
return fmt.Errorf("%s: %w", asset.ControlPlaneCreationError, withSyncErr)
}
return nil
}

0 comments on commit ff9a521

Please sign in to comment.