Skip to content

Commit

Permalink
Merge pull request openshift#248 from openshift-cherrypick-robot/cher…
Browse files Browse the repository at this point in the history
…ry-pick-246-to-release-4.17

[release-4.17] OCPBUGS-41817: always attempt a live pod get on miss to confirm its really not there
  • Loading branch information
openshift-merge-bot[bot] authored Sep 11, 2024
2 parents 3cba503 + 064432b commit b8d8d5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/k8sclient/k8sclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (c *ClientInfo) GetPod(namespace, name string) (*v1.Pod, error) {
return c.Client.CoreV1().Pods(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}

func (c *ClientInfo) GetPodLive(namespace, name string) (*v1.Pod, error) {
return c.Client.CoreV1().Pods(namespace).Get(context.TODO(), name, metav1.GetOptions{})
}

// DeletePod deletes a pod from kubernetes
func (c *ClientInfo) DeletePod(namespace, name string) error {
return c.Client.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{})
Expand Down
2 changes: 1 addition & 1 deletion pkg/multus/multus.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ func GetPod(kubeClient *k8s.ClientInfo, k8sArgs *types.K8sArgs, isDel bool) (*v1
// Try one more time to get the pod directly from the apiserver;
// TODO: figure out why static pods don't show up via the informer
// and always hit this case.
pod, err = kubeClient.GetPod(podNamespace, podName)
pod, err = kubeClient.GetPodLive(podNamespace, podName)
if err != nil {
return nil, cmdErr(k8sArgs, "error waiting for pod: %v", err)
}
Expand Down

0 comments on commit b8d8d5c

Please sign in to comment.