Merge pull request #105377 from damemi/wire-contexts-apps

Wire contexts to Apps controllers
This commit is contained in:
Kubernetes Prow Robot
2021-10-14 06:59:19 -07:00
committed by GitHub
36 changed files with 404 additions and 375 deletions

View File

@@ -545,7 +545,7 @@ func (jm *Controller) getPodsForJob(j *batch.Job, withFinalizers bool) ([]*v1.Po
}
// If any adoptions are attempted, we should first recheck for deletion
// with an uncached quorum read sometime after listing Pods (see #42639).
canAdoptFunc := controller.RecheckDeletionTimestamp(func() (metav1.Object, error) {
canAdoptFunc := controller.RecheckDeletionTimestamp(func(ctx context.Context) (metav1.Object, error) {
fresh, err := jm.kubeClient.BatchV1().Jobs(j.Namespace).Get(context.TODO(), j.Name, metav1.GetOptions{})
if err != nil {
return nil, err
@@ -561,7 +561,7 @@ func (jm *Controller) getPodsForJob(j *batch.Job, withFinalizers bool) ([]*v1.Po
}
cm := controller.NewPodControllerRefManager(jm.podControl, j, selector, controllerKind, canAdoptFunc, finalizers...)
// When adopting Pods, this operation adds an ownerRef and finalizers.
pods, err = cm.ClaimPods(pods)
pods, err = cm.ClaimPods(context.TODO(), pods)
if err != nil || !withFinalizers {
return pods, err
}