merge conf
parent
7b9fbd88d3
commit
f3a1dec0f2
|
@ -32,19 +32,17 @@ import (
|
|||
func ServiceStatus(cr command.Runner, svc string) state.State {
|
||||
active := sysinit.New(cr).Active(svc)
|
||||
if active {
|
||||
klog.Infof("%s status = running", svc)
|
||||
return state.Running
|
||||
}
|
||||
klog.Infof("%s status = not running", svc)
|
||||
return state.Stopped
|
||||
}
|
||||
|
||||
// WaitForKubelet will wait for Kubelet service to be running ...
|
||||
func WaitForKubelet(cr command.Runner, timeout time.Duration) error {
|
||||
// WaitForService will wait for a systemd or init.d service to be running on the node...
|
||||
func WaitForService(cr command.Runner, svc string, timeout time.Duration) error {
|
||||
pStart := time.Now()
|
||||
klog.Infof("waiting for kubelet to be running ....")
|
||||
kr := func() error {
|
||||
if st := ServiceStatus(cr); st != state.Running {
|
||||
if st := ServiceStatus(cr, svc); st != state.Running {
|
||||
return fmt.Errorf("status %s", st)
|
||||
}
|
||||
return nil
|
||||
|
@ -54,7 +52,7 @@ func WaitForKubelet(cr command.Runner, timeout time.Duration) error {
|
|||
return fmt.Errorf("not running: %s", err)
|
||||
}
|
||||
|
||||
klog.Infof("duration metric: took %s WaitForKubelet to finish.", time.Since(pStart))
|
||||
klog.Infof("duration metric: took %s WaitForService to finish.", time.Since(pStart))
|
||||
|
||||
return nil
|
||||
|
||||
|
|
|
@ -22,14 +22,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
<<<<<<< HEAD
|
||||
"github.com/docker/machine/libmachine/state"
|
||||
||||||| parent of a1b34164f (ensure kubelet is running and wait for it)
|
||||
"github.com/docker/machine/libmachine/state"
|
||||
"github.com/golang/glog"
|
||||
=======
|
||||
"github.com/golang/glog"
|
||||
>>>>>>> a1b34164f (ensure kubelet is running and wait for it)
|
||||
"github.com/pkg/errors"
|
||||
core "k8s.io/api/core/v1"
|
||||
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -161,5 +153,3 @@ func announceProblems(r cruntime.Manager, bs bootstrapper.Bootstrapper, cfg conf
|
|||
time.Sleep(kconst.APICallRetryInterval * 15)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ func (k *Bootstrapper) WaitForNode(cfg config.ClusterConfig, n config.Node, time
|
|||
}
|
||||
}
|
||||
if cfg.VerifyComponents[kverify.KubeletKey] {
|
||||
if err := kverify.WaitForKubelet(k.c, timeout); err != nil {
|
||||
if err := kverify.WaitForService(k.c, "kubelet", timeout); err != nil {
|
||||
return errors.Wrap(err, "waiting for kubelet")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue