Commit ee4c4736 authored by hurf's avatar hurf

Fix nits in resourceQuota admission

Fix small typo in comments and error message.
parent d5b33614
...@@ -194,7 +194,7 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli ...@@ -194,7 +194,7 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
if a.GetResource() == "pods" { if a.GetResource() == "pods" {
for _, resourceName := range []api.ResourceName{api.ResourceMemory, api.ResourceCPU} { for _, resourceName := range []api.ResourceName{api.ResourceMemory, api.ResourceCPU} {
// ignore tracking the resource if its not in the quota document // ignore tracking the resource if it's not in the quota document
if !set[resourceName] { if !set[resourceName] {
continue continue
} }
...@@ -250,7 +250,7 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli ...@@ -250,7 +250,7 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
} }
if newUsageValue > hardUsageValue { if newUsageValue > hardUsageValue {
return false, fmt.Errorf("Unable to admit pod without exceeding quota for resource %s. Limited to %s but require %s to succeed.", resourceName, hard.String(), newUsage.String()) return false, fmt.Errorf("Unable to admit pod without exceeding quota for resource %s: Limited to %s but require %s to succeed.", resourceName, hard.String(), newUsage.String())
} else { } else {
status.Used[resourceName] = *newUsage status.Used[resourceName] = *newUsage
dirty = true dirty = true
......
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