Pod Not Found Error with `hostNetwork: true` Using Node Name Instead of Pod Name
- Dominant language
- Go
- Stars
- 134
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
### Problem Description
When I deploy using Helm and set hostNetwork: true, the Pod encounters an error during execution:
> `Pod not found`
`` 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.
Contributor guide
Assessment
This issue has not been assessed yet.