mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
dep: lift kube dependency to v0.18.6
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
be9e7cf956
commit
02b8cd0b4b
@ -117,6 +117,7 @@ func calculateResourceAllocatableRequest(nodeInfo *schedulernodeinfo.NodeInfo, p
|
||||
|
||||
// calculatePodResourceRequest returns the total non-zero requests. If Overhead is defined for the pod and the
|
||||
// PodOverhead feature is enabled, the Overhead is added to the result.
|
||||
// podResourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead
|
||||
func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 {
|
||||
var podRequest int64
|
||||
for i := range pod.Spec.Containers {
|
||||
@ -125,11 +126,20 @@ func calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 {
|
||||
podRequest += value
|
||||
}
|
||||
|
||||
for i := range pod.Spec.InitContainers {
|
||||
initContainer := &pod.Spec.InitContainers[i]
|
||||
value := schedutil.GetNonzeroRequestForResource(resource, &initContainer.Resources.Requests)
|
||||
if podRequest < value {
|
||||
podRequest = value
|
||||
}
|
||||
}
|
||||
|
||||
// If Overhead is being utilized, add to the total requests for the pod
|
||||
if pod.Spec.Overhead != nil && utilfeature.DefaultFeatureGate.Enabled(features.PodOverhead) {
|
||||
if quantity, found := pod.Spec.Overhead[resource]; found {
|
||||
podRequest += quantity.Value()
|
||||
}
|
||||
}
|
||||
|
||||
return podRequest
|
||||
}
|
||||
|
Reference in New Issue
Block a user