From 1ec1efdb637e484c358555145566aa4987d5cce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mudrini=C4=87?= Date: Wed, 9 Sep 2020 20:32:00 +0200 Subject: [PATCH] Explicitly restart Kubelet on upgrade for Ubuntu (#1098) * Explicitly restart Kubelet on upgrade for Ubuntu * Update test fixtures --- pkg/scripts/os.go | 4 ++++ pkg/scripts/testdata/TestKubeadmDebian-simple.golden | 1 + .../testdata/TestUpgradeKubeletAndKubectlDebian.golden | 1 + 3 files changed, 6 insertions(+) diff --git a/pkg/scripts/os.go b/pkg/scripts/os.go index e98edd117..9f2dcf8f3 100644 --- a/pkg/scripts/os.go +++ b/pkg/scripts/os.go @@ -100,6 +100,10 @@ sudo apt-mark hold docker-ce docker-ce-cli kubelet kubeadm kubectl kubernetes-cn sudo systemctl daemon-reload sudo systemctl enable --now docker sudo systemctl enable --now kubelet + +{{- if or .FORCE .KUBELET }} +sudo systemctl restart kubelet +{{- end }} ` kubeadmCentOSTemplate = ` diff --git a/pkg/scripts/testdata/TestKubeadmDebian-simple.golden b/pkg/scripts/testdata/TestKubeadmDebian-simple.golden index 5c8f91311..b0afda5c6 100644 --- a/pkg/scripts/testdata/TestKubeadmDebian-simple.golden +++ b/pkg/scripts/testdata/TestKubeadmDebian-simple.golden @@ -84,3 +84,4 @@ sudo apt-mark hold docker-ce docker-ce-cli kubelet kubeadm kubectl kubernetes-cn sudo systemctl daemon-reload sudo systemctl enable --now docker sudo systemctl enable --now kubelet +sudo systemctl restart kubelet diff --git a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden index befd1881d..44b8fea29 100644 --- a/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden +++ b/pkg/scripts/testdata/TestUpgradeKubeletAndKubectlDebian.golden @@ -84,3 +84,4 @@ sudo apt-mark hold docker-ce docker-ce-cli kubelet kubeadm kubectl kubernetes-cn sudo systemctl daemon-reload sudo systemctl enable --now docker sudo systemctl enable --now kubelet +sudo systemctl restart kubelet