@@ -52,6 +52,7 @@ import (
5252 "github.com/openshift/installer/pkg/types/baremetal"
5353 "github.com/openshift/installer/pkg/types/gcp"
5454 "github.com/openshift/installer/pkg/types/vsphere"
55+ baremetalutils "github.com/openshift/installer/pkg/utils/baremetal"
5556 cov1helpers "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers"
5657 "github.com/openshift/library-go/pkg/route/routeapihelpers"
5758)
@@ -435,42 +436,53 @@ func waitForBootstrapComplete(ctx context.Context, config *rest.Config) *cluster
435436 return newAPIError (err )
436437 }
437438
438- if err := waitForBootstrapConfigMap (ctx , client ); err != nil {
439- return err
440- }
439+ var platformName string
441440
442- if err := waitForStableSNOBootstrap (ctx , config ); err != nil {
443- return newBootstrapError (err )
441+ if assetStore , err := assetstore .NewStore (command .RootOpts .Dir ); err == nil {
442+ if installConfig , err := assetStore .Load (& installconfig.InstallConfig {}); err == nil && installConfig != nil {
443+ platformName = installConfig .(* installconfig.InstallConfig ).Config .Platform .Name ()
444+ }
444445 }
445446
446- return nil
447- }
448-
449- // waitForBootstrapConfigMap watches the configmaps in the kube-system namespace
450- // and waits for the bootstrap configmap to report that bootstrapping has
451- // completed.
452- func waitForBootstrapConfigMap (ctx context.Context , client * kubernetes.Clientset ) * clusterCreateError {
453447 timeout := 30 * time .Minute
454448
455449 // Wait longer for baremetal, VSphere due to length of time it takes to boot
456- if assetStore , err := assetstore .NewStore (command .RootOpts .Dir ); err == nil {
457- if installConfig , err := assetStore .Load (& installconfig.InstallConfig {}); err == nil && installConfig != nil {
458- if installConfig .(* installconfig.InstallConfig ).Config .Platform .Name () == baremetal .Name || installConfig .(* installconfig.InstallConfig ).Config .Platform .Name () == vsphere .Name {
459- timeout = 60 * time .Minute
460- }
461- }
450+ if platformName == baremetal .Name || platformName == vsphere .Name {
451+ timeout = 60 * time .Minute
462452 }
463453
464- untilTime : = time .Now ().Add (timeout )
465- timezone , _ : = untilTime .Zone ()
454+ untilTime = time .Now ().Add (timeout )
455+ timezone , _ = untilTime .Zone ()
466456 logrus .Infof ("Waiting up to %v (until %v %s) for bootstrapping to complete..." ,
467457 timeout , untilTime .Format (time .Kitchen ), timezone )
468458
469459 waitCtx , cancel := context .WithTimeout (ctx , timeout )
470460 defer cancel ()
471461
462+ if platformName == baremetal .Name {
463+ if err := baremetalutils .WaitForBaremetalBootstrapControlPlane (waitCtx , config ); err != nil {
464+ return newBootstrapError (err )
465+ }
466+ logrus .Infof (" Baremetal control plane finished provisioning." )
467+ }
468+
469+ if err := waitForBootstrapConfigMap (waitCtx , client ); err != nil {
470+ return err
471+ }
472+
473+ if err := waitForStableSNOBootstrap (ctx , config ); err != nil {
474+ return newBootstrapError (err )
475+ }
476+
477+ return nil
478+ }
479+
480+ // waitForBootstrapConfigMap watches the configmaps in the kube-system namespace
481+ // and waits for the bootstrap configmap to report that bootstrapping has
482+ // completed.
483+ func waitForBootstrapConfigMap (ctx context.Context , client * kubernetes.Clientset ) * clusterCreateError {
472484 _ , err := clientwatch .UntilWithSync (
473- waitCtx ,
485+ ctx ,
474486 cache .NewListWatchFromClient (client .CoreV1 ().RESTClient (), "configmaps" , "kube-system" , fields .OneTermEqualSelector ("metadata.name" , "bootstrap" )),
475487 & corev1.ConfigMap {},
476488 nil ,
0 commit comments