mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Fix missing display of BestEffort resources in kubectl describe
This commit is contained in:
parent
9419bfb402
commit
f062a29e34
@ -23,7 +23,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
Guaranteed = "Guaranteed"
|
Guaranteed = "Guaranteed"
|
||||||
Burstable = "Burstable"
|
Burstable = "Burstable"
|
||||||
BestEffort = "Best-Effort"
|
BestEffort = "BestEffort"
|
||||||
)
|
)
|
||||||
|
|
||||||
// isResourceGuaranteed returns true if the container's resource requirements are Guaranteed.
|
// isResourceGuaranteed returns true if the container's resource requirements are Guaranteed.
|
||||||
@ -62,9 +62,17 @@ func GetQoS(container *api.Container) map[api.ResourceName]string {
|
|||||||
return resourceToQoS
|
return resourceToQoS
|
||||||
}
|
}
|
||||||
|
|
||||||
// allResources returns a set of resources the container has
|
// supportedComputeResources returns a list of supported compute resources
|
||||||
|
func supportedComputeResources() []api.ResourceName {
|
||||||
|
return []api.ResourceName{api.ResourceCPU, api.ResourceMemory}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
resources[resource] = false
|
||||||
|
}
|
||||||
for resource := range container.Resources.Requests {
|
for resource := range container.Resources.Requests {
|
||||||
resources[resource] = true
|
resources[resource] = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user