summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_restart.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-24 13:12:06 +0100
committerGitHub <noreply@github.com>2020-03-24 13:12:06 +0100
commit3dbf2cb5aff67f82e486cd95aca170e44b8fc75a (patch)
tree0e67d02bcdb5caed701c22b332a4ad6f2bbe6fe6 /pkg/api/handlers/compat/containers_restart.go
parenta2ffd5c230ea6f53ed40ccc60e869164fee41899 (diff)
parent9536560b4f3a38fbba4ac61c357dd3627fb6cf4e (diff)
downloadpodman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.tar.gz
podman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.tar.bz2
podman-3dbf2cb5aff67f82e486cd95aca170e44b8fc75a.zip
Merge pull request #5581 from baude/v2containers
podmanv2 add core container commands
Diffstat (limited to 'pkg/api/handlers/compat/containers_restart.go')
-rw-r--r--pkg/api/handlers/compat/containers_restart.go16
1 files changed, 0 insertions, 16 deletions
diff --git a/pkg/api/handlers/compat/containers_restart.go b/pkg/api/handlers/compat/containers_restart.go
index 5b8fafaa4..343bf96d2 100644
--- a/pkg/api/handlers/compat/containers_restart.go
+++ b/pkg/api/handlers/compat/containers_restart.go
@@ -1,11 +1,9 @@
package compat
import (
- "fmt"
"net/http"
"github.com/containers/libpod/libpod"
- "github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/pkg/api/handlers/utils"
"github.com/gorilla/schema"
"github.com/pkg/errors"
@@ -32,20 +30,6 @@ func RestartContainer(w http.ResponseWriter, r *http.Request) {
return
}
- state, err := con.State()
- if err != nil {
- utils.InternalServerError(w, err)
- return
- }
-
- // FIXME: This is not in the swagger.yml...
- // If the Container is stopped already, send a 409
- if state == define.ContainerStateStopped || state == define.ContainerStateExited {
- msg := fmt.Sprintf("Container %s is not running", name)
- utils.Error(w, msg, http.StatusConflict, errors.New(msg))
- return
- }
-
timeout := con.StopTimeout()
if _, found := r.URL.Query()["t"]; found {
timeout = uint(query.Timeout)