Merge pull request #10208 from Luap99/play-kube-mac

add --mac-address to podman play kube
This commit is contained in:
OpenShift Merge Robot
2021-05-05 10:10:16 -04:00
committed by GitHub
10 changed files with 92 additions and 16 deletions

View File

@@ -1717,7 +1717,7 @@ spec:
}
})
It("podman play kube --ip", func() {
It("podman play kube --ip and --mac-address", func() {
var i, numReplicas int32
numReplicas = 3
deployment := getDeployment(withReplicas(numReplicas))
@@ -1735,6 +1735,10 @@ spec:
for _, ip := range ips {
playArgs = append(playArgs, "--ip", ip)
}
macs := []string{"e8:d8:82:c9:80:40", "e8:d8:82:c9:80:50", "e8:d8:82:c9:80:60"}
for _, mac := range macs {
playArgs = append(playArgs, "--mac-address", mac)
}
kube := podmanTest.Podman(append(playArgs, kubeYaml))
kube.WaitWithDefaultTimeout()
@@ -1747,6 +1751,13 @@ spec:
Expect(inspect.ExitCode()).To(Equal(0))
Expect(inspect.OutputToString()).To(Equal(ips[i]))
}
for i = 0; i < numReplicas; i++ {
inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(&podNames[i]), "--format", "{{ .NetworkSettings.Networks." + net + ".MacAddress }}"})
inspect.WaitWithDefaultTimeout()
Expect(inspect.ExitCode()).To(Equal(0))
Expect(inspect.OutputToString()).To(Equal(macs[i]))
}
})
It("podman play kube test with network portbindings", func() {