Skip to content

Commit

Permalink
show subnet, gateway ip on network
Browse files Browse the repository at this point in the history
  • Loading branch information
ernesto27 committed Jun 27, 2023
1 parent cbec219 commit 46b6e52
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions models/network_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ func GetNetworkRows(networkList []types.NetworkResource, query string) []table.R

var rows []table.Row
for _, network := range filtered {
subnet := ""
gateway := ""
if len(network.IPAM.Config) > 0 {
subnet = network.IPAM.Config[0].Subnet
gateway = network.IPAM.Config[0].Gateway
}

rows = append(rows, table.Row{
network.ID,
network.Name,
network.Driver,
"",
"",
subnet,
gateway,
})
}

Expand Down

0 comments on commit 46b6e52

Please sign in to comment.