From ea9b47acfaa191ef57c3c2204585917c1167ee3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mudrini=C4=87?= Date: Tue, 22 Nov 2022 13:30:06 +0100 Subject: [PATCH] Fix NPE when determining if it is safe to repair a cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marko Mudrinić --- pkg/state/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/state/cluster.go b/pkg/state/cluster.go index e081a59a4..37c91fb01 100644 --- a/pkg/state/cluster.go +++ b/pkg/state/cluster.go @@ -242,7 +242,7 @@ func (c *Cluster) SafeToRepair(targetVersion string) (bool, string) { var highestVer *semver.Version for _, host := range c.ControlPlane { - if !host.IsInCluster { + if !host.IsInCluster || host.Kubelet.Version == nil { continue } if highestVer == nil || host.Kubelet.Version.GreaterThan(highestVer) {