Skip to content

Commit

Permalink
Fix IPv6 docker issue
Browse files Browse the repository at this point in the history
Note: Docker containers were not getting IPv6 assigned because
      netplugin was not giving it earlier

Signed-off-by: Yuva Shankar <yuva29@users.noreply.github.com>
  • Loading branch information
yuva29 committed Sep 8, 2017
1 parent 9740990 commit d111222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/ovsd/ovsdbDriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,13 @@ func (d *OvsdbDriver) GetOfpPortNo(intfName string) (uint32, error) {

if err == nil && len(row) > 0 && len(row[0].Rows) > 0 {
value := row[0].Rows[0]["ofport"]
if value != -1 && reflect.TypeOf(value).Kind() == reflect.Float64 {
if reflect.TypeOf(value).Kind() == reflect.Float64 {
//retry few more time. Due to asynchronous call between
//port creation and populating ovsdb entry for the interface
//may not be populated instantly.
ofpPort := uint32(reflect.ValueOf(value).Float())
return ofpPort, nil
if ofpPort := reflect.ValueOf(value).Float(); ofpPort != -1 {
return uint32(ofpPort), nil
}
}
}
time.Sleep(300 * time.Millisecond)
Expand Down
1 change: 1 addition & 0 deletions netmaster/docknet/docknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func CreateDockNet(tenantName, networkName, serviceName string, nwCfg *mastercfg
IPAM: &ipamCfg,
Options: netPluginOptions,
Attachable: true,
EnableIPv6: (subnetCIDRv6 != ""),
}

log.Infof("Creating docker network: %+v", nwCreate)
Expand Down

0 comments on commit d111222

Please sign in to comment.