Merge pull request #10092 from afbjorklund/podman-debian

Handle podman installations without default bridge
pull/10095/head
Medya Ghazizadeh 2021-01-05 15:00:19 -08:00 committed by GitHub
commit 662f2c3ebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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())
}