From 36f229f28eaa8a215ec76b2ce278be45a4590875 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Tue, 18 May 2021 09:43:51 +0200 Subject: [PATCH] fix podman query to get subnets to include in the proxy env Co-authored-by: Florian BEZANNIER --- pkg/cluster/internal/providers/podman/provision.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/internal/providers/podman/provision.go b/pkg/cluster/internal/providers/podman/provision.go index 2cbb4345d0..51dce4860b 100644 --- a/pkg/cluster/internal/providers/podman/provision.go +++ b/pkg/cluster/internal/providers/podman/provision.go @@ -281,7 +281,8 @@ func getProxyEnv(cfg *config.Cluster, networkName string) (map[string]string, er } func getSubnets(networkName string) ([]string, error) { - format := `{{range (index (index . "IPAM") "Config")}}{{index . "Subnet"}} {{end}}` + // TODO: unmarshall json and get rid of this complex query + format := `{{ range (index (index (index (index . "plugins") 0 ) "ipam" ) "ranges")}}{{ index ( index . 0 ) "subnet" }} {{end}}` cmd := exec.Command("podman", "network", "inspect", "-f", format, networkName) lines, err := exec.OutputLines(cmd) if err != nil {