Merge pull request #118635 from ffromani/devmgr-check-pod-running

kubelet: devices: skip allocation for running pods
This commit is contained in:
Kubernetes Prow Robot
2023-07-15 05:43:16 -07:00
committed by GitHub
9 changed files with 300 additions and 130 deletions

View File

@@ -721,11 +721,14 @@ func hasFailed(hasFailed bool) types.GomegaMatcher {
}).WithTemplate("expected Pod failed {{.To}} be in {{format .Data}}\nGot instead:\n{{.FormattedActual}}").WithTemplateData(hasFailed)
}
func getPod(ctx context.Context, f *framework.Framework, podName string) (bool, error) {
func getPodByName(ctx context.Context, f *framework.Framework, podName string) (*v1.Pod, error) {
return e2epod.NewPodClient(f).Get(ctx, podName, metav1.GetOptions{})
}
pod, err := e2epod.NewPodClient(f).Get(ctx, podName, metav1.GetOptions{})
func getPod(ctx context.Context, f *framework.Framework, podName string) (bool, error) {
pod, err := getPodByName(ctx, f, podName)
if err != nil {
return false, fmt.Errorf("expected node to get pod=%q got err=%q", pod.Name, err)
return false, err
}
expectedStatusReason := "UnexpectedAdmissionError"