Skip to content

Commit dc45ae3

Browse files
committed
Clarify limit ranger use of status resources
1 parent 13ae28b commit dc45ae3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

plugin/pkg/admission/limitranger/admission.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ func PodValidateLimitFunc(limitRange *corev1.LimitRange, pod *api.Pod) error {
545545

546546
// podRequests is a simplified version of pkg/api/v1/resource/PodRequests that operates against the core version of
547547
// pod. Any changes to that calculation should be reflected here.
548+
// NOTE: We do not want to check status resources here, only the spec. This is equivalent to setting
549+
// UseStatusResources=false in the common helper.
548550
// TODO: Maybe we can consider doing a partial conversion of the pod to a v1
549551
// type and then using the pkg/api/v1/resource/PodRequests.
550552
func podRequests(pod *api.Pod) api.ResourceList {
@@ -585,6 +587,8 @@ func podRequests(pod *api.Pod) api.ResourceList {
585587

586588
// podLimits is a simplified version of pkg/api/v1/resource/PodLimits that operates against the core version of
587589
// pod. Any changes to that calculation should be reflected here.
590+
// NOTE: We do not want to check status resources here, only the spec. This is equivalent to setting
591+
// UseStatusResources=false in the common helper.
588592
// TODO: Maybe we can consider doing a partial conversion of the pod to a v1
589593
// type and then using the pkg/api/v1/resource/PodLimits.
590594
func podLimits(pod *api.Pod) api.ResourceList {

0 commit comments

Comments
 (0)