diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-17 05:52:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 05:52:51 -0400 |
commit | 676c33f07950b29b657370df5e767452692be648 (patch) | |
tree | 4a3ba7067472b1c3a9f1756f54a18816f84dd603 /test/e2e | |
parent | 35b62ef19f307fb365eb7a8734e456160f7b22a8 (diff) | |
parent | d7292dbf2731701c122656400ce5007693efe3c8 (diff) | |
download | podman-676c33f07950b29b657370df5e767452692be648.tar.gz podman-676c33f07950b29b657370df5e767452692be648.tar.bz2 podman-676c33f07950b29b657370df5e767452692be648.zip |
Merge pull request #10043 from Luap99/play-kube-ip
add --ip to podman play kube
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/play_kube_test.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index e479b88cc..5c25c4459 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -12,6 +12,7 @@ import ( "github.com/containers/podman/v3/pkg/util" . "github.com/containers/podman/v3/test/utils" + "github.com/containers/storage/pkg/stringid" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/opencontainers/selinux/go-selinux" @@ -1716,6 +1717,38 @@ spec: } }) + It("podman play kube --ip", func() { + var i, numReplicas int32 + numReplicas = 3 + deployment := getDeployment(withReplicas(numReplicas)) + err := generateKubeYaml("deployment", deployment, kubeYaml) + Expect(err).To(BeNil()) + + net := "playkube" + stringid.GenerateNonCryptoID() + session := podmanTest.Podman([]string{"network", "create", "--subnet", "10.25.31.0/24", net}) + session.WaitWithDefaultTimeout() + defer podmanTest.removeCNINetwork(net) + Expect(session.ExitCode()).To(BeZero()) + + ips := []string{"10.25.31.5", "10.25.31.10", "10.25.31.15"} + playArgs := []string{"play", "kube", "--network", net} + for _, ip := range ips { + playArgs = append(playArgs, "--ip", ip) + } + + kube := podmanTest.Podman(append(playArgs, kubeYaml)) + kube.WaitWithDefaultTimeout() + Expect(kube.ExitCode()).To(Equal(0)) + + podNames := getPodNamesInDeployment(deployment) + for i = 0; i < numReplicas; i++ { + inspect := podmanTest.Podman([]string{"inspect", getCtrNameInPod(&podNames[i]), "--format", "{{ .NetworkSettings.Networks." + net + ".IPAddress }}"}) + inspect.WaitWithDefaultTimeout() + Expect(inspect.ExitCode()).To(Equal(0)) + Expect(inspect.OutputToString()).To(Equal(ips[i])) + } + }) + It("podman play kube test with network portbindings", func() { ip := "127.0.0.100" port := "5000" |