func GetQoS(container *api.Container) map[api.ResourceName]string {
	resourceToQoS := map[api.ResourceName]string{}
	for resource := range allResources(container) {
		switch {
		case isResourceGuaranteed(container, resource):
			resourceToQoS[resource] = Guaranteed
		case isResourceBestEffort(container, resource):
			resourceToQoS[resource] = BestEffort
		default:
			resourceToQoS[resource] = Burstable
		}
	}
	return resourceToQoS
}
GetQos returns a mapping of resource name to QoS class of a container
package util
import (
	"k8s.io/kubernetes/pkg/api"
)
const (
	Guaranteed = "Guaranteed"
	Burstable  = "Burstable"
	BestEffort = "BestEffort"
)
func isResourceGuaranteed(container *api.Container, resource api.ResourceName) bool {
	req, hasReq := container.Resources.Requests[resource]
	limit, hasLimit := container.Resources.Limits[resource]
	if !hasReq || !hasLimit {
		return false
	}
	return req.Cmp(limit) == 0 && req.Value() != 0
}
func isResourceBestEffort(container *api.Container, resource api.ResourceName) bool {
	req, hasReq := container.Resources.Requests[resource]
	return !hasReq || req.Value() == 0
}