Skip to content

Commit

Permalink
nil check to avoid panic on upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
(cherry picked from commit ce3a732)
Signed-off-by: Derek McGowan <derek@mcg.dev>
  • Loading branch information
mikebrow authored and dmcgowan committed Dec 14, 2022
1 parent f7e578e commit c8889df
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 c8889df

Please sign in to comment.