Skip to content

Commit b171744

Browse files
committed
ipam: fix ippool with single dual-stack address (#3054)
1 parent c1a8d92 commit b171744

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/pod.go

+3
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,9 @@ func (c *Controller) acquireAddress(pod *v1.Pod, podNet *kubeovnNet) (string, st
14481448
ipPool = strings.Split(pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)], ";")
14491449
} else {
14501450
ipPool = strings.Split(pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)], ",")
1451+
if len(ipPool) == 2 && util.CheckProtocol(ipPool[0]) != util.CheckProtocol(ipPool[1]) {
1452+
ipPool = []string{pod.Annotations[fmt.Sprintf(util.IpPoolAnnotationTemplate, podNet.ProviderName)]}
1453+
}
14511454
}
14521455
for i, ip := range ipPool {
14531456
ipPool[i] = strings.TrimSpace(ip)

0 commit comments

Comments
 (0)