
On systems where the calculated cpu shares results in a value above the max value in linux, containers getting that value are unable to start. This occur on systems with 300+ cpu cores, and where containers are given such a value. This issue was fixed for the pod and qos control groups in the similar cm.MilliCPUToShares that also has tests verifying the behavior. Since this code already has an dependency on kubelet/cm, lets reuse that code instead.
21 lines
627 B
Go
21 lines
627 B
Go
//go:build !linux
|
|
// +build !linux
|
|
|
|
/*
|
|
Copyright 2018 The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package kuberuntime
|