diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-11-02 16:11:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 16:11:28 +0100 |
commit | 0d5aef47d3b5322d8d7d876a27ff06b5eb71c97a (patch) | |
tree | 48a221e026a4039d10fa7e509b91f9cc220f0874 /pkg/bindings/test/common_test.go | |
parent | 0686f0bb2ff22abae7ca90f1b17b32d73b8615a8 (diff) | |
parent | f2115471ddf40123a26c87f8903cc8cf2be57980 (diff) | |
download | podman-0d5aef47d3b5322d8d7d876a27ff06b5eb71c97a.tar.gz podman-0d5aef47d3b5322d8d7d876a27ff06b5eb71c97a.tar.bz2 podman-0d5aef47d3b5322d8d7d876a27ff06b5eb71c97a.zip |
Merge pull request #12051 from machacekondra/fix_http409_errorhandling
Handle HTTP 409 error messages properly
Diffstat (limited to 'pkg/bindings/test/common_test.go')
-rw-r--r-- | pkg/bindings/test/common_test.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pkg/bindings/test/common_test.go b/pkg/bindings/test/common_test.go index 91ebe21fc..d996595bf 100644 --- a/pkg/bindings/test/common_test.go +++ b/pkg/bindings/test/common_test.go @@ -225,12 +225,23 @@ func (b *bindingTest) RunTopContainer(containerName *string, podName *string) (s // This method creates a pod with the given pod name. // Podname is an optional parameter func (b *bindingTest) Podcreate(name *string) { + b.PodcreateAndExpose(name, nil) +} + +// This method creates a pod with the given pod name and publish port. +// Podname is an optional parameter +// port is an optional parameter +func (b *bindingTest) PodcreateAndExpose(name *string, port *string) { + command := []string{"pod", "create"} if name != nil { podname := *name - b.runPodman([]string{"pod", "create", "--name", podname}).Wait(45) - } else { - b.runPodman([]string{"pod", "create"}).Wait(45) + command = append(command, "--name", podname) + } + if port != nil { + podport := *port + command = append(command, "--publish", podport) } + b.runPodman(command).Wait(45) } // StringInSlice returns a boolean based on whether a given |