Skip to content

Commit

Permalink
Add add route in generateClientCommand, cc #154
Browse files Browse the repository at this point in the history
For init container, add add route in generateClientCommand

Signed-off-by: sufuf3 <[email protected]>
  • Loading branch information
sufuf3 authored and hwchiu committed Jul 25, 2018
1 parent 7756b47 commit 3d59825
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ func generateClientCommand(network entity.PodNetwork) (command []string) {
if network.VlanTag != nil {
command = append(command, "-v="+strconv.Itoa((int)(*network.VlanTag)))
}
// Support one command with one add route in first version
if network.Routes != nil {
if network.Routes[0].Gateway != "" {
command = append(command, "--net="+network.Routes[0].DstCIDR, "-g="+network.Routes[0].Gateway)
} else {
command = append(command, "--net="+network.Routes[0].DstCIDR)
}
}
return
}

Expand Down

0 comments on commit 3d59825

Please sign in to comment.