Skip to content

Commit

Permalink
show 'NA' in table output if IPv6 address is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
karimra committed Nov 20, 2020
1 parent a5d7b9f commit 08b1606
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,16 @@ func getContainerIPv6(container types.Container, bridgeName string) string {
}
if bridgeName != "" {
if br, ok := container.NetworkSettings.Networks[bridgeName]; ok {
if br.GlobalIPv6Address == "" {
return "NA"
}
return fmt.Sprintf("%s/%d", br.GlobalIPv6Address, br.GlobalIPv6PrefixLen)
}
}
for _, br := range container.NetworkSettings.Networks {
if br.GlobalIPv6Address == "" {
return "NA"
}
return fmt.Sprintf("%s/%d", br.GlobalIPv6Address, br.GlobalIPv6PrefixLen)
}
return ""
Expand Down

0 comments on commit 08b1606

Please sign in to comment.