summaryrefslogtreecommitdiff
path: root/pkg/bindings/play
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-05-04 17:06:57 +0200
committerPaul Holzinger <paul.holzinger@web.de>2021-05-04 20:14:13 +0200
commitfb7d16c7a841bbe2c02cb97b2820334b617e7f44 (patch)
treebb82d46a3565624611c0696ef51efd903e82e6c1 /pkg/bindings/play
parentdea6189982b4d128aa1ae9ce379a1f94b4eb8a8f (diff)
downloadpodman-fb7d16c7a841bbe2c02cb97b2820334b617e7f44.tar.gz
podman-fb7d16c7a841bbe2c02cb97b2820334b617e7f44.tar.bz2
podman-fb7d16c7a841bbe2c02cb97b2820334b617e7f44.zip
add --mac-address to podman play kube
Add a new --mac-address flag to podman play kube. This is used to specify a static MAC address which should be used for the pod. This option can be specified several times because play kube can create more than one pod. Fixes #9731 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg/bindings/play')
-rw-r--r--pkg/bindings/play/types.go2
-rw-r--r--pkg/bindings/play/types_kube_options.go16
2 files changed, 18 insertions, 0 deletions
diff --git a/pkg/bindings/play/types.go b/pkg/bindings/play/types.go
index 6598ec3c2..52a72c7b6 100644
--- a/pkg/bindings/play/types.go
+++ b/pkg/bindings/play/types.go
@@ -27,6 +27,8 @@ type KubeOptions struct {
SeccompProfileRoot *string
// StaticIPs - Static IP address used by the pod(s).
StaticIPs *[]net.IP
+ // StaticMACs - Static MAC address used by the pod(s).
+ StaticMACs *[]net.HardwareAddr
// ConfigMaps - slice of pathnames to kubernetes configmap YAMLs.
ConfigMaps *[]string
// LogDriver for the container. For example: journald
diff --git a/pkg/bindings/play/types_kube_options.go b/pkg/bindings/play/types_kube_options.go
index a1786f553..4cc7d6f21 100644
--- a/pkg/bindings/play/types_kube_options.go
+++ b/pkg/bindings/play/types_kube_options.go
@@ -181,6 +181,22 @@ func (o *KubeOptions) GetStaticIPs() []net.IP {
return *o.StaticIPs
}
+// WithStaticMACs
+func (o *KubeOptions) WithStaticMACs(value []net.HardwareAddr) *KubeOptions {
+ v := &value
+ o.StaticMACs = v
+ return o
+}
+
+// GetStaticMACs
+func (o *KubeOptions) GetStaticMACs() []net.HardwareAddr {
+ var staticMACs []net.HardwareAddr
+ if o.StaticMACs == nil {
+ return staticMACs
+ }
+ return *o.StaticMACs
+}
+
// WithConfigMaps
func (o *KubeOptions) WithConfigMaps(value []string) *KubeOptions {
v := &value