Skip to content

Commit

Permalink
Merge pull request #2096 from frobware/fix-segv-in-updateReadinessStats
Browse files Browse the repository at this point in the history
Fix potential SEGV in updateReadinessStats
  • Loading branch information
k8s-ci-robot authored Jun 11, 2019
2 parents c4fc0d8 + 91016a6 commit dd89fb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cluster-autoscaler/clusterstate/clusterstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ func (csr *ClusterStateRegistry) updateReadinessStats(currentTime time.Time) {
klog.Warningf("Failed to get nodegroup for %s: %v", unregistered.Node.Name, errNg)
continue
}
if nodeGroup == nil {
klog.Warningf("Nodegroup is nil for %s", unregistered.Node.Name)
continue
}
perNgCopy := perNodeGroup[nodeGroup.Id()]
if unregistered.UnregisteredSince.Add(csr.config.MaxNodeProvisionTime).Before(currentTime) {
perNgCopy.LongUnregistered++
Expand Down

0 comments on commit dd89fb1

Please sign in to comment.