Skip to content

Commit

Permalink
Fix NPE when determining if it is safe to repair a cluster (#2496)
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
kubermatic-bot and xmudrii authored Nov 22, 2022
1 parent 066988a commit 50abb0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/state/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 50abb0c

Please sign in to comment.