diff --git a/src/installer/installer.go b/src/installer/installer.go index 10e7f9584..2f0de89c3 100644 --- a/src/installer/installer.go +++ b/src/installer/installer.go @@ -410,6 +410,18 @@ func (i *installer) startBootstrap() error { return err } + // If we're in a pure RHEL/CentOS environment, we need to overlay the node image + // first to have access to e.g. oc, kubelet, cri-o, etc... + // https://github.com/openshift/enhancements/pull/1637 + if !i.ops.FileExists("/usr/bin/oc") { + err = i.ops.SystemctlAction("start", "node-image-overlay.service") + if err != nil { + return err + } + + i.waitForNodeImageOverlay(context.Background()) + } + servicesToStart := []string{"bootkube.service", "approve-csr.service", "progress.service"} for _, service := range servicesToStart { err = i.ops.SystemctlAction("start", service) @@ -626,6 +638,25 @@ func (i *installer) waitForBootkube(ctx context.Context) { } } +func (i *installer) waitForNodeImageOverlay(ctx context.Context) { + i.log.Infof("Waiting for node image overlay to complete") + + for { + select { + case <-ctx.Done(): + i.log.Info("Context cancelled, terminating wait for node image overlay\n") + return + case <-time.After(generalWaitInterval): + out, err := i.ops.ExecPrivilegeCommand(nil, "systemctl", "is-active", "node-image-overlay.service") + if err == nil { + i.log.Info("node image overlay service completed") + return + } + i.log.Debugf("node image overlay service not yet active: %s", out) + } + } +} + func (i *installer) waitForController(kc k8s_client.K8SClient) error { i.log.Infof("Waiting for controller to be ready") i.UpdateHostInstallProgress(models.HostStageWaitingForController, "waiting for controller pod ready event")