Skip to content

Commit a29d00c

Browse files
committed
static ip in exclude-ips can be allocated normally when subnet's availableIPs is 0 #3031
1 parent 58eef01 commit a29d00c

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

pkg/controller/pod.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,7 @@ func (c *Controller) getNameByPod(pod *v1.Pod) string {
17091709
return pod.Name
17101710
}
17111711

1712+
// When subnet's v4availableIPs is 0 but still there's available ip in exclude-ips, the static ip in exclude-ips can be allocated normal.
17121713
func (c *Controller) getNsAvailableSubnets(pod *v1.Pod, podNet *kubeovnNet) ([]*kubeovnNet, error) {
17131714
var result []*kubeovnNet
17141715
// keep the annotation subnet of the pod in first position
@@ -1734,19 +1735,6 @@ func (c *Controller) getNsAvailableSubnets(pod *v1.Pod, podNet *kubeovnNet) ([]*
17341735
return nil, err
17351736
}
17361737

1737-
switch subnet.Spec.Protocol {
1738-
case kubeovnv1.ProtocolIPv4:
1739-
fallthrough
1740-
case kubeovnv1.ProtocolDual:
1741-
if subnet.Status.V4AvailableIPs == 0 {
1742-
continue
1743-
}
1744-
case kubeovnv1.ProtocolIPv6:
1745-
if subnet.Status.V6AvailableIPs == 0 {
1746-
continue
1747-
}
1748-
}
1749-
17501738
result = append(result, &kubeovnNet{
17511739
Type: providerTypeOriginal,
17521740
ProviderName: subnet.Spec.Provider,

0 commit comments

Comments
 (0)