diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-17 07:34:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 07:34:32 -0500 |
commit | d55d80a04105968574c1a1d0e0589806b95c044c (patch) | |
tree | ef33ddde8d9e19455e7712f473983d169f914ffd /pkg/api/handlers/compat/secrets.go | |
parent | 50042120e947fc7aee601f0c65ea485daf604ee1 (diff) | |
parent | 68a8d397cec73e956abc71da692bf89d5ff58a86 (diff) | |
download | podman-d55d80a04105968574c1a1d0e0589806b95c044c.tar.gz podman-d55d80a04105968574c1a1d0e0589806b95c044c.tar.bz2 podman-d55d80a04105968574c1a1d0e0589806b95c044c.zip |
Merge pull request #9360 from riyad/add-missing-early-returns
Add missing early returns in compat API
Diffstat (limited to 'pkg/api/handlers/compat/secrets.go')
-rw-r--r-- | pkg/api/handlers/compat/secrets.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/secrets.go b/pkg/api/handlers/compat/secrets.go index 571888eba..ff737cddc 100644 --- a/pkg/api/handlers/compat/secrets.go +++ b/pkg/api/handlers/compat/secrets.go @@ -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()) @@ -95,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) |