Skip to content

Commit

Permalink
set subnet ranges only if both v4 and v6 are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Nov 20, 2020
1 parent 2c5d2cc commit 6b64e3e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions clab/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,16 @@ type Endpoint struct {

// ParseIPInfo parses IP information
func (c *cLab) parseIPInfo() error {
// DockerInfo = t.DockerInfo
if c.Config.Mgmt.Network == "" {
c.Config.Mgmt.Network = dockerNetName
}
if c.Config.Mgmt.Ipv4Subnet == "" {
c.Config.Mgmt.Ipv4Subnet = dockerNetIPv4Addr
}
if c.Config.Mgmt.Ipv6Subnet == "" {
c.Config.Mgmt.Ipv6Subnet = dockerNetIPv6Addr
if c.Config.Mgmt.Ipv4Subnet == "" && c.Config.Mgmt.Ipv6Subnet == "" {
if c.Config.Mgmt.Ipv4Subnet == "" {
c.Config.Mgmt.Ipv4Subnet = dockerNetIPv4Addr
}
if c.Config.Mgmt.Ipv6Subnet == "" {
c.Config.Mgmt.Ipv6Subnet = dockerNetIPv6Addr
}
}
return nil
}
Expand Down

0 comments on commit 6b64e3e

Please sign in to comment.