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()) }