From d8adb1b5a85bb32332f4239e9270c6bcc48d6a88 Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 16 Jun 2022 17:07:14 +0800 Subject: [PATCH] fix #74: upgrade node if only one control plane as a workaround --- operations/upgrade.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/operations/upgrade.go b/operations/upgrade.go index df45787..1ac24c8 100644 --- a/operations/upgrade.go +++ b/operations/upgrade.go @@ -156,7 +156,9 @@ func planNextUpgrade(operation *operatorv1.Operation, version string, c client.C log.Info("failed to list nodes.", "error", err) return items } - if len(cpNodes.Items) > 1 { + // Workaround: if isServerCanSkip, the only server's kubelet may need to upgrade. + // TODO to make more accurate task, we may cut tasks into small ones, for instance, upgrade kubelet only. + if len(cpNodes.Items) > 1 || isServerCanSkip { t2.Spec.Template.Spec.Commands = append(t2.Spec.Template.Spec.Commands, operatorv1.CommandDescriptor{