Skip to content

Commit

Permalink
ipam: fix ippool with single dual-stack address (#3054)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Jul 19, 2023
1 parent c1a8d92 commit b171744
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,9 @@ func (c *Controller) acquireAddress(pod *v1.Pod, podNet *kubeovnNet) (string, st
ipPool = strings.Split(pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)], ";")
} else {
ipPool = strings.Split(pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)], ",")
if len(ipPool) == 2 && util.CheckProtocol(ipPool[0]) != util.CheckProtocol(ipPool[1]) {
ipPool = []string{pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)]}
}
}
for i, ip := range ipPool {
ipPool[i] = strings.TrimSpace(ip)
Expand Down

0 comments on commit b171744

Please sign in to comment.