From f22a3802c72202efdbbf60e050d5a3e125838dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Tue, 5 Jan 2021 17:06:52 +0100 Subject: [PATCH] Handle podman installations without default bridge --- pkg/drivers/kic/oci/network_create.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/drivers/kic/oci/network_create.go b/pkg/drivers/kic/oci/network_create.go index 1dee5b2053cb..cde14b2b0537 100644 --- a/pkg/drivers/kic/oci/network_create.go +++ b/pkg/drivers/kic/oci/network_create.go @@ -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()) }