update cri-plugin to parse hugepages limit from CRI message
Signed-off-by: Byonggon Chun <bg.chun@samsung.com>
This commit is contained in:
		| @@ -427,6 +427,7 @@ func WithResources(resources *runtime.LinuxContainerResources) oci.SpecOpts { | ||||
| 			q         = resources.GetCpuQuota() | ||||
| 			shares    = uint64(resources.GetCpuShares()) | ||||
| 			limit     = resources.GetMemoryLimitInBytes() | ||||
| 			hugepages = resources.GetHugepageLimits() | ||||
| 		) | ||||
|  | ||||
| 		if p != 0 { | ||||
| @@ -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 | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Byonggon Chun
					Byonggon Chun