mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	e2e: node: expose the running flag
				
					
				
			Each e2e test knows it wants to restart a running kubelet or a non-running kubelet. The vast majority of times, we want to restart a running kubelet (e.g. to change config or to check some properties hold across kubelet crashes/restarts), but sometimes we stop the kubelet, do some actions and only then restart. To accomodate both use cases, we just expose the `running` boolean flag to the e2e tests. Having the `restartKubelet` explicitly restarting a running kubelet helps us to trobuleshoot e2e failures on which the kubelet was supposed to be running, while it was not; attempting a restart in such cases only murkied the waters further, making the troubleshooting and the eventual fix harder. In the happy path, no expected change in behaviour. Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
		| @@ -414,8 +414,8 @@ func findKubletServiceName(running bool) string { | ||||
| 	return kubeletServiceName | ||||
| } | ||||
|  | ||||
| func restartKubelet() { | ||||
| 	kubeletServiceName := findKubletServiceName(false) | ||||
| func restartKubelet(running bool) { | ||||
| 	kubeletServiceName := findKubletServiceName(running) | ||||
| 	// 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, %s", err, string(stdout)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user