-
k8s-merge-robot authored
Automatic merge from submit-queue PodWorkers UpdatePod takes options struct First commit from https://github.com/kubernetes/kubernetes/pull/24843 Second commit: The `PodWorkers.UpdatePod` operation is updated as follows: * use options struct to pass arguments * add a pod status func to allow override status * add pod termination grace period if sync operation requires a kill pod * add a call-back that is error aware Third commit: Add a `killPodNow` to kubelet that does a blocking kill pod call that properly integrates with pod workers. The plan is to pass `killPodNow` as a function pointer into the out of resource killer. ``` // KillPodFunc kills a pod. // The pod status is updated, and then it is killed with the specified grace period. // This function must block until either the pod is killed or an error is encountered. // Arguments: // pod - the pod to kill // status - the desired status to associate with the pod (i.e. why its killed) // gracePeriodOverride - the grace period override to use instead of what is on the pod spec type KillPodFunc func(pod *api.Pod, status api.PodStatus, gracePeriodOverride *int64) error ``` You can see it being used here in the WIP out of resource killer PR. https://github.com/kubernetes/kubernetes/pull/21274/commits/1344f858fba956c285eba6c418a3008576cd3843#diff-92ff0f643237f29824b4929574f84609R277 /cc @vishh @yujuhong @pmorie
a503bcd7