summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/secrets.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/secrets.go')
-rw-r--r--pkg/api/handlers/compat/secrets.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/pkg/api/handlers/compat/secrets.go b/pkg/api/handlers/compat/secrets.go
index ea2dfc707..c5ee8c324 100644
--- a/pkg/api/handlers/compat/secrets.go
+++ b/pkg/api/handlers/compat/secrets.go
@@ -7,10 +7,10 @@ import (
"fmt"
"net/http"
- "github.com/containers/podman/v2/libpod"
- "github.com/containers/podman/v2/pkg/api/handlers/utils"
- "github.com/containers/podman/v2/pkg/domain/entities"
- "github.com/containers/podman/v2/pkg/domain/infra/abi"
+ "github.com/containers/podman/v3/libpod"
+ "github.com/containers/podman/v3/pkg/api/handlers/utils"
+ "github.com/containers/podman/v3/pkg/domain/entities"
+ "github.com/containers/podman/v3/pkg/domain/infra/abi"
"github.com/gorilla/schema"
"github.com/pkg/errors"
)
@@ -30,7 +30,9 @@ func ListSecrets(w http.ResponseWriter, r *http.Request) {
return
}
if len(query.Filters) > 0 {
- utils.Error(w, "filters not supported", http.StatusBadRequest, errors.New("bad parameter"))
+ utils.Error(w, "filters not supported", http.StatusBadRequest,
+ errors.Wrapf(errors.New("bad parameter"), "filters not supported"))
+ return
}
ic := abi.ContainerEngine{Libpod: runtime}
reports, err := ic.SecretList(r.Context())
@@ -58,7 +60,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) {
@@ -96,7 +97,9 @@ func CreateSecret(w http.ResponseWriter, r *http.Request) {
return
}
if len(createParams.Labels) > 0 {
- utils.Error(w, "labels not supported", http.StatusBadRequest, errors.New("bad parameter"))
+ utils.Error(w, "labels not supported", http.StatusBadRequest,
+ errors.Wrapf(errors.New("bad parameter"), "labels not supported"))
+ return
}
decoded, _ := base64.StdEncoding.DecodeString(createParams.Data)