nil check to avoid panic on upgrade#7809
Conversation
Signed-off-by: Mike Brown <[email protected]>
|
introduced here: #6517 |
|
/lgtm |
kzys
left a comment
There was a problem hiding this comment.
Looks good to me. We should have some tests here.
|
How are there even nil entries in the slice to begin with? |
|
Thanks for fixing it! /lgtm |
good question .. #7661 is related |
|
Weird.. I can't see how that could cause nil entries, but couldn't that code also just be: hugepageLimits := make([]*runtime.HugepageLimit, len(s.Resources.Linux.HugepageLimits))
for idx, l := range s.Resources.Linux.HugepageLimits {
limit := &runtime.HugepageLimit{
PageSize: l.PageSize,
Limit: l.Limit,
}
hugepageLimits[idx] = limit
} |
Yeah we could use indexing won't fix the exception though.. I've not found proof of the root cause. I asked for a pod spec.. My repro was local via abusing the deep copy code.. |
|
On mobile or I'd try and look also for a little 😭. Let's get this in though and we can plug away |
to fix #7806
Signed-off-by: Mike Brown [email protected]