Skip to content

Commit

Permalink
fix podman query to get subnets to include in the proxy env
Browse files Browse the repository at this point in the history
Co-authored-by: Florian BEZANNIER
  • Loading branch information
aojea authored and BenTheElder committed May 18, 2021
1 parent ce3a4ee commit 36f229f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cluster/internal/providers/podman/provision.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 36f229f

Please sign in to comment.