summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-06 09:16:04 -0400
committerGitHub <noreply@github.com>2021-05-06 09:16:04 -0400
commitd6000a0b86fc835bca5cd28722ad75228a809629 (patch)
treef8e9d72f59df2de34ffe7d6a4d84002ce33b1d55 /cmd/podman/common
parentb6405c1ae6fb1ac6b08493fa8e2f77a0fe9ff39e (diff)
parentc0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2 (diff)
downloadpodman-d6000a0b86fc835bca5cd28722ad75228a809629.tar.gz
podman-d6000a0b86fc835bca5cd28722ad75228a809629.tar.bz2
podman-d6000a0b86fc835bca5cd28722ad75228a809629.zip
Merge pull request #10246 from zhangguanzhang/compose-static-ip
Fixes docker-compose cannot set static ip when use ipam
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/create_opts.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go
index ca36d751e..77ac781a5 100644
--- a/cmd/podman/common/create_opts.go
+++ b/cmd/podman/common/create_opts.go
@@ -302,6 +302,11 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup
staticIP := net.ParseIP(ep.IPAddress)
netInfo.StaticIP = &staticIP
}
+ // if IPAMConfig.IPv4Address is provided
+ if ep.IPAMConfig != nil && ep.IPAMConfig.IPv4Address != "" {
+ staticIP := net.ParseIP(ep.IPAMConfig.IPv4Address)
+ netInfo.StaticIP = &staticIP
+ }
// If MAC address is provided
if len(ep.MacAddress) > 0 {
staticMac, err := net.ParseMAC(ep.MacAddress)