Merge pull request #135514 from klaskosk/fix-135512

kubectl: remove context.TODO from daemonSetFilter
This commit is contained in:
Kubernetes Prow Robot
2025-12-17 22:36:51 -08:00
committed by GitHub

View File

@@ -17,7 +17,6 @@ limitations under the License.
package drain
import (
"context"
"fmt"
"strings"
"time"
@@ -193,7 +192,7 @@ func (d *Helper) daemonSetFilter(pod corev1.Pod) PodDeleteStatus {
return MakePodDeleteStatusOkay()
}
if _, err := d.Client.AppsV1().DaemonSets(pod.Namespace).Get(context.TODO(), controllerRef.Name, metav1.GetOptions{}); err != nil {
if _, err := d.Client.AppsV1().DaemonSets(pod.Namespace).Get(d.getContext(), controllerRef.Name, metav1.GetOptions{}); err != nil {
// remove orphaned pods with a warning if --force is used
if apierrors.IsNotFound(err) && d.Force {
return MakePodDeleteStatusWithWarning(true, err.Error())