You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If some of these are populated, we know it at least understands resizing
464
464
iflen(container.ResizePolicy) >0 {
465
465
noRestartPoliciesPopulated=false
466
466
}
467
467
468
-
// TODO(maxcao13): Do we have to check the policy resource too? i.e. if only memory is getting scaled, then only check the memory resize policy?
468
+
// TODO: We should check the containerResizePolicy resource and compare it with the requested update resources.
469
+
// For example, if we are only updating CPU, and the CPU container resize policy is NotRequired, but the memory
470
+
// resize policy is RestartContainer, then it's not going to accept an in-place disruptionless update, even though it should.
471
+
// For now this function, cannot actually see the resource(s) to be updated,
469
472
for_, policy:=rangecontainer.ResizePolicy {
470
473
ifpolicy.RestartPolicy!=apiv1.NotRequired {
471
-
klog.InfoS("in-place resize of pod will cause container disruption, because of container resize policy", "pod", klog.KObj(pod), "container", container.Name, "restartPolicy", policy.RestartPolicy)
474
+
klog.V(4).InfoS("in-place resize of pod will cause container disruption, because of container resize policy", "pod", klog.KObj(pod), "container", container.Name, "containerResizeRestartPolicy", policy.RestartPolicy)
472
475
// TODO(jkyros): is there something that prevents this from happening elsewhere in the API?
klog.Warningf("in-place resize of %s not possible, container %s resize policy is %v but pod restartPolicy is %v", pod.Name, container.Name, policy.RestartPolicy, pod.Spec.RestartPolicy)
476
+
ifisPodRestartPolicyNever {
477
+
klog.InfoS("in-place resize of pod not possible, container resize policy and pod restartPolicy conflict", "pod", klog.KObj(pod), "container", container.Name, "containerResizeRestartPolicy", policy.RestartPolicy, "podRestartPolicy", pod.Spec.RestartPolicy)
475
478
returnfalse
476
479
}
477
-
478
480
}
479
481
}
480
482
}
@@ -591,7 +593,7 @@ func (e *podsEvictionRestrictionImpl) InPlaceUpdate(podToUpdate *apiv1.Pod, vpa
591
593
klog.V(4).InfoS("Patched pod annotations", "pod", klog.KObj(res), "patches", string(patch))
592
594
}
593
595
} else {
594
-
err:=fmt.Errorf("no patches to apply to %s", podToUpdate.Name)
596
+
err:=fmt.Errorf("no resource patches were calculated to apply")
595
597
klog.ErrorS(err, "Failed to patch pod", "pod", klog.KObj(podToUpdate))
596
598
returnerr
597
599
}
@@ -606,7 +608,7 @@ func (e *podsEvictionRestrictionImpl) InPlaceUpdate(podToUpdate *apiv1.Pod, vpa
0 commit comments