Handle podman installations without default bridge

pull/10092/head
Anders F Björklund 2021-01-05 17:06:52 +01:00
parent 65f7a71e08
commit f22a3802c7
1 changed files with 6 additions and 1 deletions

View File

@ -221,8 +221,13 @@ func podmanNetworkInspect(name string) (netInfo, error) {
return info, err
}
output := rr.Stdout.String()
if output == "" {
return info, fmt.Errorf("no bridge network found for %s", name)
}
// results looks like 172.17.0.0/16,172.17.0.1,1500
vals := strings.Split(strings.TrimSpace(rr.Stdout.String()), ",")
vals := strings.Split(strings.TrimSpace(output), ",")
if len(vals) == 0 {
return info, fmt.Errorf("empty list network inspect: %q", rr.Output())
}