1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

Support ControlPlaneCreationError on baremetal

Wraps control plane provisioning errors on baremetal IPI with the
ControlPlaneCreationError so that gather bootstrap will run
automatically in that case.
This commit is contained in:
Patrick Dillon
2024-10-24 11:17:47 -04:00
parent a0960a3c3f
commit ff9a5214e7

View File

@@ -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"
)
@@ -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
}