mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Merge pull request #17479 from mqliang/hardcode
Auto commit by PR queue bot
This commit is contained in:
commit
f9715c6455
@ -62,15 +62,16 @@ func GetQoS(container *api.Container) map[api.ResourceName]string {
|
|||||||
return resourceToQoS
|
return resourceToQoS
|
||||||
}
|
}
|
||||||
|
|
||||||
// supportedComputeResources returns a list of supported compute resources
|
// supportedComputeResources is the list of supported compute resources
|
||||||
func supportedComputeResources() []api.ResourceName {
|
var supportedComputeResources = []api.ResourceName{
|
||||||
return []api.ResourceName{api.ResourceCPU, api.ResourceMemory}
|
api.ResourceCPU,
|
||||||
|
api.ResourceMemory,
|
||||||
}
|
}
|
||||||
|
|
||||||
// allResources returns a set of all possible resources whose mapped key value is true if present on the container
|
// allResources returns a set of all possible resources whose mapped key value is true if present on the container
|
||||||
func allResources(container *api.Container) map[api.ResourceName]bool {
|
func allResources(container *api.Container) map[api.ResourceName]bool {
|
||||||
resources := map[api.ResourceName]bool{}
|
resources := map[api.ResourceName]bool{}
|
||||||
for _, resource := range supportedComputeResources() {
|
for _, resource := range supportedComputeResources {
|
||||||
resources[resource] = false
|
resources[resource] = false
|
||||||
}
|
}
|
||||||
for resource := range container.Resources.Requests {
|
for resource := range container.Resources.Requests {
|
||||||
|
Loading…
Reference in New Issue
Block a user