Skip to content

Commit

Permalink
Added comment for pod.UID usage
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
  • Loading branch information
p-strusiewiczsurmacki-mobica committed Sep 24, 2024
1 parent 122f2fe commit be5d0cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v2/pkg/nodenet/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ func (pn *podNetwork) Update(podIPv4, podIPv6 net.IP, hook SetupHook, pod *corev
}
}
} else {
// We need to bind PodNetConf with Pod. When Coil is a primary CNI IP address can be used for that.
// However different CNIs manage IP addresses diferently, therefore, in egress-only mode instead of
// storing container's ID in ContainerId, we store pod's UID there to be able to identify pod that was
// used to create particular PodNetConf.
if c.ContainerId == string(pod.UID) {
netNsPath, err = getNetNsPath(c.HostVethName)
if err != nil {
Expand Down

0 comments on commit be5d0cc

Please sign in to comment.