Christian Kellner
6087e2d90e
run-builder: inspect network to get gateway IP
...
Instead of inferring the gateway ip via the the network device for
the podman bridge, where the name can change, use podman network
inspect.
```js
The json looks like this:
[
{
"cniVersion": "0.4.0",
"name": "org.osbuild.koji",
"plugins": [
{
"bridge": "cni-podman1",
"hairpinMode": true,
"ipMasq": true,
"ipam": {
"ranges": [
[
{
"gateway": "10.89.0.1",
"subnet": "10.89.0.0/24"
}
]
],
"routes": [
{
"dst": "0.0.0.0/0"
}
],
"type": "host-local"
},
"isGateway": true,
"type": "bridge"
},
{
"capabilities": {
"portMappings": true
},
"type": "portmap"
},
{
"backend": "",
"type": "firewall"
},
{
"domainName": "dns.podman",
"type": "dnsname"
}
]
}
]
```
So the podman format for this is very obviously:
{{ (index (index (index .plugins 0).ipam.ranges 0) 0).gateway }}
2020-09-09 14:35:58 +02:00