Skip to content

Commit

Permalink
netpol: Fix ipset only containing one IP when port name is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
BoleynSu authored and aauren committed Oct 7, 2023
1 parent 384ed97 commit f0d7f1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controllers/netpol/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,8 @@ func (npc *NetworkPolicyController) grabNamedPortFromPod(pod *api.Pod, namedPort
protocolAndPort: protocolAndPort{port: containerPort, protocol: protocol},
}
} else {
eps.ips = ips
eps.ips[api.IPv4Protocol] = append(eps.ips[api.IPv4Protocol], ips[api.IPv4Protocol]...)
eps.ips[api.IPv6Protocol] = append(eps.ips[api.IPv6Protocol], ips[api.IPv6Protocol]...)
}
}
}
Expand Down

0 comments on commit f0d7f1e

Please sign in to comment.