summaryrefslogtreecommitdiff
path: root/libpod/network/netconflist.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-16 22:30:45 +0000
committerGitHub <noreply@github.com>2020-12-16 22:30:45 +0000
commit915ae6d9bfa39515d7280f29b5d7d072753cc788 (patch)
treebc3b2295bf6f6e0f45230d5d5d37dc1077b47ddb /libpod/network/netconflist.go
parente75dc3d536a9f8f457dfc35482ff61efc80cbb09 (diff)
parentedf0e918e32f4f109329881310b798f3b2c7defb (diff)
downloadpodman-915ae6d9bfa39515d7280f29b5d7d072753cc788.tar.gz
podman-915ae6d9bfa39515d7280f29b5d7d072753cc788.tar.bz2
podman-915ae6d9bfa39515d7280f29b5d7d072753cc788.zip
Merge pull request #8756 from Luap99/fix-8748
Always add the default gateway to the cni config file
Diffstat (limited to 'libpod/network/netconflist.go')
-rw-r--r--libpod/network/netconflist.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/network/netconflist.go b/libpod/network/netconflist.go
index d61b96ecb..af25ee59c 100644
--- a/libpod/network/netconflist.go
+++ b/libpod/network/netconflist.go
@@ -95,6 +95,10 @@ func NewIPAMLocalHostRange(subnet *net.IPNet, ipRange *net.IPNet, gw net.IP) ([]
}
if gw != nil {
hostRange.Gateway = gw.String()
+ } else {
+ // Add first ip in subnet as gateway. It is not required
+ // by cni but should be included because of network inspect.
+ hostRange.Gateway = CalcGatewayIP(subnet).String()
}
ranges = append(ranges, hostRange)
return ranges, nil