Donot insert iptables when sidecar not injected
- Dominant language
- Go
- Stars
- 757
- Forks
- 276
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 2
Description
**What would you like to be added**:
```
enableSidecar, _ := checkSidecar(client, pod)
enableKmesh := isKmeshManaged(pod)
if !enableSidecar && !enableKmesh {
log.Info("do not need process, pod is not managed by sidecar or kmesh")
return
}
```
In bypass controller, we check whether sidecar or kmesh enabled for the pod, this is right. But the way it checks sidecar, it ir nor right
If a namespace with injection label, we donot check whether pod has a sidecar anymore. And similarly, we also check pod annotation, without checking sidecar.
This can be mistaken, when the pod is started earlier.
**Why is this needed**:
Contributor guide
Research direction
Start at the bypass controller and read the checkSidecar and isKmeshManaged checks shown in the issue. Trace how namespace injection labels and pod annotations are handled, then verify that iptables processing is skipped for pods without an injected sidecar while managed pods continue to be processed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100