Skip to content

Commit

Permalink
Merge pull request #7820 from dmcgowan/1.6-nil-check-hugepagelimits
Browse files Browse the repository at this point in the history
[release/1.6] nil check to avoid panic on upgrade
  • Loading branch information
dmcgowan committed Dec 14, 2022
2 parents 7d02c97 + c8889df commit 34f7cec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/cri/store/container/status.go
Expand Up @@ -222,10 +222,12 @@ func deepCopyOf(s Status) Status {
if s.Resources != nil && s.Resources.Linux != nil {
hugepageLimits := make([]*runtime.HugepageLimit, len(s.Resources.Linux.HugepageLimits))
for _, l := range s.Resources.Linux.HugepageLimits {
hugepageLimits = append(hugepageLimits, &runtime.HugepageLimit{
PageSize: l.PageSize,
Limit: l.Limit,
})
if l != nil {
hugepageLimits = append(hugepageLimits, &runtime.HugepageLimit{
PageSize: l.PageSize,
Limit: l.Limit,
})
}
}
copy.Resources = &runtime.ContainerResources{
Linux: &runtime.LinuxContainerResources{
Expand Down

0 comments on commit 34f7cec

Please sign in to comment.