returnapierrors.NewForbidden(a.GetResource(),name,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing limit ranges",a.GetOperation(),resource))
returnadmission.NewForbidden(a,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing limit ranges",a.GetOperation(),resource))
returnapierrors.NewForbidden(a.GetResource(),name,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing quota",a.GetOperation(),resource))
returnadmission.NewForbidden(a,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing quota",a.GetOperation(),a.GetResource()))
returnapierrors.NewForbidden(a.GetResource(),name,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing quota",a.GetOperation(),a.GetResource()))
returnadmission.NewForbidden(a,fmt.Errorf("Unable to %s %s at this time because there was an error enforcing quota",a.GetOperation(),a.GetResource()))
@@ -154,10 +140,10 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
ifhardFound{
used,usedFound:=status.Used[resourceName]
if!usedFound{
returnfalse,apierrors.NewForbidden(a.GetResource(),name,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed."))
returnfalse,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed.")
}
ifused.Value()>=hard.Value(){
returnfalse,apierrors.NewForbidden(a.GetResource(),name,fmt.Errorf("Limited to %s %s",hard.String(),a.GetResource()))
returnfalse,fmt.Errorf("Limited to %s %s",hard.String(),resourceName)
@@ -185,10 +171,10 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
ifhardMemFound{
used,usedFound:=status.Used[api.ResourceMemory]
if!usedFound{
returnfalse,apierrors.NewForbidden(resourceName,name,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed."))
returnfalse,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed.")
@@ -198,10 +184,10 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
ifhardCPUFound{
used,usedFound:=status.Used[api.ResourceCPU]
if!usedFound{
returnfalse,apierrors.NewForbidden(resourceName,name,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed."))
returnfalse,fmt.Errorf("Quota usage stats are not yet known, unable to admit resource until an accurate count is completed.")