Azure / Azure/peerd

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

Open
#61 1 comment 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.