aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_attach.go
diff options
context:
space:
mode:
authorJakub Guzik <jguzik@redhat.com>2022-01-21 23:56:23 +0100
committerJakub Guzik <jguzik@redhat.com>2022-01-22 00:31:18 +0100
commit7938f32c532557eff69ada6a29b46906c3e691a3 (patch)
tree8dd31a941623eee1e46e6911ebbdae28c91e77df /pkg/api/handlers/compat/containers_attach.go
parentd847ad598d752dad479250b7f289858cc272cb04 (diff)
downloadpodman-7938f32c532557eff69ada6a29b46906c3e691a3.tar.gz
podman-7938f32c532557eff69ada6a29b46906c3e691a3.tar.bz2
podman-7938f32c532557eff69ada6a29b46906c3e691a3.zip
Remove unused param and clean API handlers
This commit removes error message string from utils.Error in pkg/api. Param was not used inside a function for quite a long time [NO NEW TESTS NEEDED] Signed-off-by: Jakub Guzik <jguzik@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/containers_attach.go')
-rw-r--r--pkg/api/handlers/compat/containers_attach.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go
index ccdf054b9..027dadaa3 100644
--- a/pkg/api/handlers/compat/containers_attach.go
+++ b/pkg/api/handlers/compat/containers_attach.go
@@ -28,7 +28,7 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) {
Stream: true,
}
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
- utils.Error(w, "Error parsing parameters", http.StatusBadRequest, err)
+ utils.Error(w, http.StatusBadRequest, err)
return
}
@@ -60,13 +60,13 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) {
streams = nil
}
if useStreams && !streams.Stdout && !streams.Stderr && !streams.Stdin {
- utils.Error(w, "Parameter conflict", http.StatusBadRequest, errors.Errorf("at least one of stdin, stdout, stderr must be true"))
+ utils.Error(w, http.StatusBadRequest, errors.Errorf("at least one of stdin, stdout, stderr must be true"))
return
}
// At least one of these must be set
if !query.Stream && !query.Logs {
- utils.Error(w, "Unsupported parameter", http.StatusBadRequest, errors.Errorf("at least one of Logs or Stream must be set"))
+ utils.Error(w, http.StatusBadRequest, errors.Errorf("at least one of Logs or Stream must be set"))
return
}
@@ -85,7 +85,7 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) {
// For Docker compatibility, we need to re-initialize containers in these states.
if state == define.ContainerStateConfigured || state == define.ContainerStateExited {
if err := ctr.Init(r.Context(), ctr.PodID() != ""); err != nil {
- utils.Error(w, "Container in wrong state", http.StatusConflict, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID()))
+ utils.Error(w, http.StatusConflict, errors.Wrapf(err, "error preparing container %s for attach", ctr.ID()))
return
}
} else if !(state == define.ContainerStateCreated || state == define.ContainerStateRunning) {