From 50abb0c05b3086f176ba9ab4c0faa3902173c923 Mon Sep 17 00:00:00 2001 From: Kubermatic Bot <41968677+kubermatic-bot@users.noreply.github.com> Date: Tue, 22 Nov 2022 15:04:56 +0100 Subject: [PATCH] Fix NPE when determining if it is safe to repair a cluster (#2496) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marko Mudrinić Signed-off-by: Marko Mudrinić Co-authored-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) {