summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorJakub Filak <jakub.filak@sap.com>2019-09-18 00:26:48 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-11-06 16:22:19 +0100
commit2497b6c77b41c70ecb4711de94de8b3a59b4c1b3 (patch)
treed0490dee84a606e35e22c63b3138367b33d30de0 /libpod/container.go
parent455f5b76169515dcc36cf4d7c1d51ead3be02e1f (diff)
downloadpodman-2497b6c77b41c70ecb4711de94de8b3a59b4c1b3.tar.gz
podman-2497b6c77b41c70ecb4711de94de8b3a59b4c1b3.tar.bz2
podman-2497b6c77b41c70ecb4711de94de8b3a59b4c1b3.zip
podman: add support for specifying MAC
I basically copied and adapted the statements for setting IP. Closes #1136 Signed-off-by: Jakub Filak <jakub.filak@sap.com>
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 8e24391b9..4f7fc067e 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -138,6 +138,10 @@ type Container struct {
// being checkpointed. If requestedIP is set it will be used instead
// of config.StaticIP.
requestedIP net.IP
+ // A restored container should have the same MAC address as before
+ // being checkpointed. If requestedMAC is set it will be used instead
+ // of config.StaticMAC.
+ requestedMAC net.HardwareAddr
// This is true if a container is restored from a checkpoint.
restoreFromCheckpoint bool
@@ -296,6 +300,10 @@ type ContainerConfig struct {
// This cannot be set unless CreateNetNS is set.
// If not set, the container will be dynamically assigned an IP by CNI.
StaticIP net.IP `json:"staticIP"`
+ // StaticMAC is a static MAC to request for the container.
+ // This cannot be set unless CreateNetNS is set.
+ // If not set, the container will be dynamically assigned a MAC by CNI.
+ StaticMAC net.HardwareAddr `json:"staticMAC"`
// PortMappings are the ports forwarded to the container's network
// namespace
// These are not used unless CreateNetNS is true