Skip to content

Commit

Permalink
Merge pull request #4950 from medyagh/none_stop_improve
Browse files Browse the repository at this point in the history
Improve driver none stop to work on older systems
  • Loading branch information
medyagh authored Aug 2, 2019
2 parents e1c485b + fdc3b39 commit ce98918
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/drivers/none/none.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ func stopKubelet(exec command.Runner) error {
glog.Infof("stopping kubelet.service ...")
stop := func() error {
cmdStop := "sudo systemctl stop kubelet.service"
cmdCheck := "sudo systemctl show -p SubState --value kubelet"
cmdCheck := "sudo systemctl show -p SubState kubelet"
err := exec.Run(cmdStop)
if err != nil {
glog.Errorf("Temporary Error for %q : %v", cmdStop, err)
glog.Errorf("temporary error for %q : %v", cmdStop, err)
}
var out bytes.Buffer
errStatus := exec.CombinedOutputTo(cmdCheck, &out)
if errStatus != nil {
glog.Errorf("Temporary Error: for %q : %v", cmdCheck, errStatus)
glog.Errorf("temporary error: for %q : %v", cmdCheck, errStatus)
}
if !strings.Contains(out.String(), "dead") {
return fmt.Errorf("expected to kubelet to be dead but it got : %q", out)
Expand All @@ -240,7 +240,7 @@ func stopKubelet(exec command.Runner) error {
}

if err := util.RetryAfter(3, stop, 2*time.Second); err != nil {
return errors.Wrapf(err, "Error stopping kubelet")
return errors.Wrapf(err, "error stopping kubelet")
}

return nil
Expand Down

0 comments on commit ce98918

Please sign in to comment.