Commit 83fc12a8 authored by mqliang's avatar mqliang

hardcode supportedComputeResources

parent 961a02a6
...@@ -62,15 +62,16 @@ func GetQoS(container *api.Container) map[api.ResourceName]string { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment