Skip to content

Commit

Permalink
add judge about nic address
Browse files Browse the repository at this point in the history
  • Loading branch information
pengbinbin1 committed May 11, 2021
1 parent c733c7e commit 123ead4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ func (c *Controller) handleUpdatePod(key string) error {
klog.Errorf("no available gateway nic address")
return fmt.Errorf("no available gateway nic address")
}
if !strings.Contains(nextHop, "/") {
klog.Errorf("gateway nic address's format is invalid")
return fmt.Errorf("gateway nic address's format is invalid")
}
nextHop = strings.Split(nextHop, "/")[0]
if addr := cm.Data["external-gw-addr"]; addr != "" {
nextHop = addr
Expand Down

0 comments on commit 123ead4

Please sign in to comment.