Show resources in pod descriptions by sorted names.

Includes container and QoS resources.
This commit is contained in:
Timo Reimann
2016-05-21 23:47:47 +02:00
parent 4d69e2c26a
commit 32aa740fd3
5 changed files with 116 additions and 8 deletions

View File

@@ -105,9 +105,12 @@ func GetPodQos(pod *api.Pod) string {
return Burstable
}
// GetQos returns a mapping of resource name to QoS class of a container
func GetQoS(container *api.Container) map[api.ResourceName]string {
resourceToQoS := map[api.ResourceName]string{}
// QoSList is a set of (resource name, QoS class) pairs.
type QoSList map[api.ResourceName]string
// GetQoS returns a mapping of resource name to QoS class of a container
func GetQoS(container *api.Container) QoSList {
resourceToQoS := QoSList{}
for resource := range allResources(container) {
switch {
case isResourceGuaranteed(container, resource):