Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
update cri-plugin to parse hugepages limit from CRI message
Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
  • Loading branch information
Byonggon Chun committed Dec 20, 2019
1 parent 85fad2b commit ca43b12
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions pkg/containerd/opts/spec_unix.go
Expand Up @@ -423,10 +423,11 @@ func WithResources(resources *runtime.LinuxContainerResources) oci.SpecOpts {
s.Linux.Resources.Memory = &runtimespec.LinuxMemory{}
}
var (
p = uint64(resources.GetCpuPeriod())
q = resources.GetCpuQuota()
shares = uint64(resources.GetCpuShares())
limit = resources.GetMemoryLimitInBytes()
p = uint64(resources.GetCpuPeriod())
q = resources.GetCpuQuota()
shares = uint64(resources.GetCpuShares())
limit = resources.GetMemoryLimitInBytes()
hugepages = resources.GetHugepageLimits()
)

if p != 0 {
Expand All @@ -447,6 +448,12 @@ func WithResources(resources *runtime.LinuxContainerResources) oci.SpecOpts {
if limit != 0 {
s.Linux.Resources.Memory.Limit = &limit
}
for _, limit := range hugepages {
s.Linux.Resources.HugepageLimits = append(s.Linux.Resources.HugepageLimits, runtimespec.LinuxHugepageLimit{
Pagesize: limit.PageSize,
Limit: limit.Limit,
})
}
return nil
}
}
Expand Down

0 comments on commit ca43b12

Please sign in to comment.