summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2022-07-11 08:06:58 +0000
committerGitHub <noreply@github.com>2022-07-11 08:06:58 +0000
commit76422ecdbbd26bf645b664ea7663e5ecf10139ba (patch)
treeec2f1d80b722efe4a2601478ba7d6e657fc30486 /pkg/api
parent87feb82b07ef5b7365c5164ea1f4ee8b928e2b51 (diff)
parent96dd57ca50de54e82cea177c317b92612ed1cf81 (diff)
downloadpodman-76422ecdbbd26bf645b664ea7663e5ecf10139ba.tar.gz
podman-76422ecdbbd26bf645b664ea7663e5ecf10139ba.tar.bz2
podman-76422ecdbbd26bf645b664ea7663e5ecf10139ba.zip
Merge pull request #14818 from rhatdan/wait
podman wait can take multiple conditions
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/utils/containers.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go
index 80f8522fd..e198bdd6c 100644
--- a/pkg/api/handlers/utils/containers.go
+++ b/pkg/api/handlers/utils/containers.go
@@ -99,9 +99,8 @@ func WaitContainerDocker(w http.ResponseWriter, r *http.Request) {
func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) {
var (
- err error
- interval = time.Millisecond * 250
- conditions = []define.ContainerStatus{define.ContainerStateStopped, define.ContainerStateExited}
+ err error
+ interval = time.Millisecond * 250
)
decoder := r.Context().Value(api.DecoderKey).(*schema.Decoder)
query := waitQueryLibpod{}
@@ -118,17 +117,10 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) {
}
}
- if _, found := r.URL.Query()["condition"]; found {
- if len(query.Condition) > 0 {
- conditions = query.Condition
- }
- }
-
name := GetName(r)
waitFn := createContainerWaitFn(r.Context(), name, interval)
-
- exitCode, err := waitFn(conditions...)
+ exitCode, err := waitFn(query.Condition...)
if err != nil {
if errors.Is(err, define.ErrNoSuchCtr) {
ContainerNotFound(w, name, err)