Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pod Not Found Error with hostNetwork: true Using Node Name Instead of Pod Name #61

Open
yantingqiu opened this issue Aug 31, 2024 · 0 comments

Comments

@yantingqiu
Copy link

Problem Description

When I deploy using Helm and set hostNetwork: true, the Pod encounters an error during execution:

Pod <pod_name> not found

<pod_name> is actually the name of the node.
Upon investigation, I found that the issue arises in the following code snippet:

pod, err := clientset.CoreV1().Pods(k.Namespace).Get(ctx, k.Name, metav1.GetOptions{})
if err != nil {
    return nil, err
}

The problem occurs because, with hostNetwork enabled, k.Name is incorrectly set to the node's name instead of the Pod's name, causing the Pod lookup to fail.

Expected Behavior

Even with hostNetwork: true enabled, the code should correctly identify and use the Pod's name to avoid this type of error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant