mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
e2e node: fix kubelet service restart failure
Under e2e tests possible the situation when we restart the kubelet number of times in the short time frame. When it happens the systemd can fail the service restart with the `Failed with result 'start-limit-hit'.` error. To avoid this situation the code will reset the kubelet service start failures on each call to the kubelet restart command. Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
This commit is contained in:
parent
ff33efc164
commit
ab7acb9ee3
@ -387,7 +387,11 @@ func findRunningKubletServiceName() string {
|
||||
|
||||
func restartKubelet() {
|
||||
kubeletServiceName := findRunningKubletServiceName()
|
||||
stdout, err := exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput()
|
||||
// reset the kubelet service start-limit-hit
|
||||
stdout, err := exec.Command("sudo", "systemctl", "reset-failed", kubeletServiceName).CombinedOutput()
|
||||
framework.ExpectNoError(err, "Failed to reset kubelet start-limit-hit with systemctl: %v, %v", err, stdout)
|
||||
|
||||
stdout, err = exec.Command("sudo", "systemctl", "restart", kubeletServiceName).CombinedOutput()
|
||||
framework.ExpectNoError(err, "Failed to restart kubelet with systemctl: %v, %v", err, stdout)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user