summaryrefslogtreecommitdiff
path: root/pkg/bindings
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-05 04:41:41 -0500
committerGitHub <noreply@github.com>2021-02-05 04:41:41 -0500
commit42d4652fed759904bb51a5d3420724dc25009494 (patch)
treee75db0e16733dfbf688168293042e972f2b1c1c0 /pkg/bindings
parent4a0ae01261f2aa90c37d95b7cc4415682e96dead (diff)
parent05444cb2ccf29515e6cb8f2711c64213b7cb3325 (diff)
downloadpodman-42d4652fed759904bb51a5d3420724dc25009494.tar.gz
podman-42d4652fed759904bb51a5d3420724dc25009494.tar.bz2
podman-42d4652fed759904bb51a5d3420724dc25009494.zip
Merge pull request #9048 from matejvasek/apiv2_wait
Fix Docker APIv2 container wait endpoint
Diffstat (limited to 'pkg/bindings')
-rw-r--r--pkg/bindings/containers/types.go2
-rw-r--r--pkg/bindings/containers/types_wait_options.go10
-rw-r--r--pkg/bindings/test/attach_test.go2
-rw-r--r--pkg/bindings/test/common_test.go2
-rw-r--r--pkg/bindings/test/containers_test.go4
5 files changed, 10 insertions, 10 deletions
diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go
index 771cde72c..4889b444a 100644
--- a/pkg/bindings/containers/types.go
+++ b/pkg/bindings/containers/types.go
@@ -176,7 +176,7 @@ type UnpauseOptions struct{}
//go:generate go run ../generator/generator.go WaitOptions
// WaitOptions are optional options for waiting on containers
type WaitOptions struct {
- Condition *define.ContainerStatus
+ Condition []define.ContainerStatus
Interval *string
}
diff --git a/pkg/bindings/containers/types_wait_options.go b/pkg/bindings/containers/types_wait_options.go
index 005cc38cb..a3f1e3b8c 100644
--- a/pkg/bindings/containers/types_wait_options.go
+++ b/pkg/bindings/containers/types_wait_options.go
@@ -76,19 +76,19 @@ func (o *WaitOptions) ToParams() (url.Values, error) {
}
// WithCondition
-func (o *WaitOptions) WithCondition(value define.ContainerStatus) *WaitOptions {
- v := &value
+func (o *WaitOptions) WithCondition(value []define.ContainerStatus) *WaitOptions {
+ v := value
o.Condition = v
return o
}
// GetCondition
-func (o *WaitOptions) GetCondition() define.ContainerStatus {
- var condition define.ContainerStatus
+func (o *WaitOptions) GetCondition() []define.ContainerStatus {
+ var condition []define.ContainerStatus
if o.Condition == nil {
return condition
}
- return *o.Condition
+ return o.Condition
}
// WithInterval
diff --git a/pkg/bindings/test/attach_test.go b/pkg/bindings/test/attach_test.go
index 9a46f6309..771b2d528 100644
--- a/pkg/bindings/test/attach_test.go
+++ b/pkg/bindings/test/attach_test.go
@@ -75,7 +75,7 @@ var _ = Describe("Podman containers attach", func() {
Expect(err).ShouldNot(HaveOccurred())
wait := define.ContainerStateRunning
- _, err = containers.Wait(bt.conn, ctnr.ID, new(containers.WaitOptions).WithCondition(wait))
+ _, err = containers.Wait(bt.conn, ctnr.ID, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{wait}))
Expect(err).ShouldNot(HaveOccurred())
tickTock := time.NewTimer(2 * time.Second)
diff --git a/pkg/bindings/test/common_test.go b/pkg/bindings/test/common_test.go
index c2b1347d2..8fbc631d8 100644
--- a/pkg/bindings/test/common_test.go
+++ b/pkg/bindings/test/common_test.go
@@ -207,7 +207,7 @@ func (b *bindingTest) RunTopContainer(containerName *string, insidePod *bool, po
return "", err
}
wait := define.ContainerStateRunning
- _, err = containers.Wait(b.conn, ctr.ID, new(containers.WaitOptions).WithCondition(wait))
+ _, err = containers.Wait(b.conn, ctr.ID, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{wait}))
return ctr.ID, err
}
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go
index 9b9f98047..14eb1ffc6 100644
--- a/pkg/bindings/test/containers_test.go
+++ b/pkg/bindings/test/containers_test.go
@@ -281,7 +281,7 @@ var _ = Describe("Podman containers ", func() {
_, err := bt.RunTopContainer(&name, nil, nil)
Expect(err).To(BeNil())
go func() {
- exitCode, err = containers.Wait(bt.conn, name, new(containers.WaitOptions).WithCondition(pause))
+ exitCode, err = containers.Wait(bt.conn, name, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{pause}))
errChan <- err
close(errChan)
}()
@@ -295,7 +295,7 @@ var _ = Describe("Podman containers ", func() {
go func() {
defer GinkgoRecover()
- _, waitErr := containers.Wait(bt.conn, name, new(containers.WaitOptions).WithCondition(running))
+ _, waitErr := containers.Wait(bt.conn, name, new(containers.WaitOptions).WithCondition([]define.ContainerStatus{running}))
unpauseErrChan <- waitErr
close(unpauseErrChan)
}()