diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-11-07 20:26:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 20:26:14 +0100 |
commit | d919961f621d0b9eb70b971fc8e8915ee279ab60 (patch) | |
tree | 05272b838219ba06a56c4d06038ae2f7d6fa1fe1 /pkg/spec | |
parent | 347499778cb1a7045dc831f99b9539bc20fe008d (diff) | |
parent | 82e4116e578f72bd627330ac10d541c3e234738c (diff) | |
download | podman-d919961f621d0b9eb70b971fc8e8915ee279ab60.tar.gz podman-d919961f621d0b9eb70b971fc8e8915ee279ab60.tar.bz2 podman-d919961f621d0b9eb70b971fc8e8915ee279ab60.zip |
Merge pull request #4451 from giuseppe/set-mac
podman: add support for specifying MAC
Diffstat (limited to 'pkg/spec')
-rw-r--r-- | pkg/spec/createconfig.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go index 2a8fe7332..e054b3b13 100644 --- a/pkg/spec/createconfig.go +++ b/pkg/spec/createconfig.go @@ -396,6 +396,14 @@ func (c *CreateConfig) getContainerCreateOptions(runtime *libpod.Runtime, pod *l options = append(options, libpod.WithStaticIP(ip)) } + if c.MacAddress != "" { + mac, err := net.ParseMAC(c.MacAddress) + if err != nil { + return nil, errors.Wrapf(define.ErrInvalidArg, "cannot parse %s as MAC address: %v", c.MacAddress, err) + } + options = append(options, libpod.WithStaticMAC(mac)) + } + options = append(options, libpod.WithPrivileged(c.Privileged)) useImageVolumes := c.ImageVolumeType == TypeBind |