Skip to content

Commit e9cb405

Browse files
update dedup comment in ipam
1 parent 419d904 commit e9cb405

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

azure-ipam/ipam.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ func (p *IPAMPlugin) CmdAdd(args *cniSkel.CmdArgs) error {
146146
for _, podIPInfo := range resp.PodIPInfo {
147147
// Skip if interface already seen
148148
// This is to avoid duplicate interfaces in the result
149-
// which can happen if multiple IPs are assigned to the same interface
150-
// or if multiple interfaces are assigned to the same pod
149+
// Deduplication is necessary because there is one podIPInfo entry for each IP family(IPv4 and IPv6), and both may point to the same interface or if multiple interfaces are assigned to the same pod
151150
if podIPInfo.MacAddress == "" || seenInterfaces[podIPInfo.MacAddress] {
152151
continue
153152
}

0 commit comments

Comments
 (0)