Skip to content

Commit

Permalink
Disable pod use NodeSwitch subnet
Browse files Browse the repository at this point in the history
Signed-off-by: zhuanlan <[email protected]>
  • Loading branch information
Longchuanzheng committed May 8, 2024
1 parent 0068ce3 commit 56a98e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,11 @@ func (c *Controller) reconcileRouteSubnets(cachedPod, pod *v1.Pod, needRoutePodN
podIP = pod.Annotations[fmt.Sprintf(util.IPAddressAnnotationTemplate, podNet.ProviderName)]
subnet = podNet.Subnet

// Check if pod uses nodeSwitch subnet
if subnet.Name == c.config.NodeSwitch {
return fmt.Errorf("NodeSwitch subnet %s is unavailable for pod", subnet.Name)
}

if (!c.config.EnableLb || !(subnet.Spec.EnableLb != nil && *subnet.Spec.EnableLb)) &&
subnet.Spec.Vpc == c.config.ClusterRouter &&
subnet.Spec.U2OInterconnection &&
Expand Down

0 comments on commit 56a98e2

Please sign in to comment.