diff options
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r-- | pkg/api/handlers/compat/containers_archive.go | 2 | ||||
-rw-r--r-- | pkg/api/handlers/compat/events.go | 1 | ||||
-rw-r--r-- | pkg/api/handlers/compat/images.go | 1 | ||||
-rw-r--r-- | pkg/api/handlers/compat/images_history.go | 1 | ||||
-rw-r--r-- | pkg/api/handlers/compat/images_remove.go | 1 | ||||
-rw-r--r-- | pkg/api/handlers/compat/networks.go | 9 | ||||
-rw-r--r-- | pkg/api/handlers/compat/secrets.go | 1 |
7 files changed, 7 insertions, 9 deletions
diff --git a/pkg/api/handlers/compat/containers_archive.go b/pkg/api/handlers/compat/containers_archive.go index 083c72ce8..55bd62f90 100644 --- a/pkg/api/handlers/compat/containers_archive.go +++ b/pkg/api/handlers/compat/containers_archive.go @@ -62,7 +62,7 @@ func handleHeadAndGet(w http.ResponseWriter, r *http.Request, decoder *schema.De w.Header().Add(copy.XDockerContainerPathStatHeader, statHeader) } - if errors.Cause(err) == define.ErrNoSuchCtr || errors.Cause(err) == copy.ENOENT { + if errors.Cause(err) == define.ErrNoSuchCtr || errors.Cause(err) == copy.ErrENOENT { // 404 is returned for an absent container and path. The // clients must deal with it accordingly. utils.Error(w, "Not found.", http.StatusNotFound, err) diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 82a74e419..7dad5f566 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -111,7 +111,6 @@ func GetEvents(w http.ResponseWriter, r *http.Request) { Until: query.Until, } errorChannel <- runtime.Events(r.Context(), readOpts) - }() var flush = func() {} diff --git a/pkg/api/handlers/compat/images.go b/pkg/api/handlers/compat/images.go index 88c59b46a..85708912b 100644 --- a/pkg/api/handlers/compat/images.go +++ b/pkg/api/handlers/compat/images.go @@ -202,7 +202,6 @@ func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) { ProgressDetail: map[string]string{}, Id: iid, }) - } func CreateImageFromImage(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/api/handlers/compat/images_history.go b/pkg/api/handlers/compat/images_history.go index 3b72798e4..174bc6234 100644 --- a/pkg/api/handlers/compat/images_history.go +++ b/pkg/api/handlers/compat/images_history.go @@ -17,7 +17,6 @@ func HistoryImage(w http.ResponseWriter, r *http.Request) { if err != nil { utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(err, "failed to find image %s", name)) return - } history, err := newImage.History(r.Context()) if err != nil { diff --git a/pkg/api/handlers/compat/images_remove.go b/pkg/api/handlers/compat/images_remove.go index 9731c521c..dd2d96bbb 100644 --- a/pkg/api/handlers/compat/images_remove.go +++ b/pkg/api/handlers/compat/images_remove.go @@ -54,5 +54,4 @@ func RemoveImage(w http.ResponseWriter, r *http.Request) { } utils.WriteResponse(w, http.StatusOK, response) - } diff --git a/pkg/api/handlers/compat/networks.go b/pkg/api/handlers/compat/networks.go index 85d2db87e..71b9d180d 100644 --- a/pkg/api/handlers/compat/networks.go +++ b/pkg/api/handlers/compat/networks.go @@ -277,10 +277,10 @@ func CreateNetwork(w http.ResponseWriter, r *http.Request) { return } body := struct { - Id string + ID string `json:"Id"` Warning []string }{ - Id: net.ID, + ID: net.ID, } utils.WriteResponse(w, http.StatusCreated, body) } @@ -400,6 +400,9 @@ func Prune(w http.ResponseWriter, r *http.Request) { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err) return } + type response struct { + NetworksDeleted []string + } var prunedNetworks []string //nolint for _, pr := range pruneReports { if pr.Error != nil { @@ -408,5 +411,5 @@ func Prune(w http.ResponseWriter, r *http.Request) { } prunedNetworks = append(prunedNetworks, pr.Name) } - utils.WriteResponse(w, http.StatusOK, prunedNetworks) + utils.WriteResponse(w, http.StatusOK, response{NetworksDeleted: prunedNetworks}) } diff --git a/pkg/api/handlers/compat/secrets.go b/pkg/api/handlers/compat/secrets.go index ea2dfc707..571888eba 100644 --- a/pkg/api/handlers/compat/secrets.go +++ b/pkg/api/handlers/compat/secrets.go @@ -58,7 +58,6 @@ func InspectSecret(w http.ResponseWriter, r *http.Request) { return } utils.WriteResponse(w, http.StatusOK, reports[0]) - } func RemoveSecret(w http.ResponseWriter, r *http.Request) { |