summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/libpod
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-04-28 13:56:45 +0200
committerPaul Holzinger <pholzing@redhat.com>2022-04-29 14:06:54 +0200
commite6557bf0a291f4462081e50461b1b9b8715d1da3 (patch)
treeef2c4160a81d264ca0d1255715f9c668c853c581 /pkg/api/handlers/libpod
parenta48c37df3765f42c779ac0674eb021f955ed9c07 (diff)
downloadpodman-e6557bf0a291f4462081e50461b1b9b8715d1da3.tar.gz
podman-e6557bf0a291f4462081e50461b1b9b8715d1da3.tar.bz2
podman-e6557bf0a291f4462081e50461b1b9b8715d1da3.zip
pkg/api: do not register decoder in endpoint handler
Since the decoder is shared registering the decoder inside a single endpoint will also register it for all others. Also the problem with that is the it will register it everytime this endpoint is called which is wrong. Instead we should register it once like the other custom decoder functions. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/api/handlers/libpod')
-rw-r--r--pkg/api/handlers/libpod/secrets.go8
1 files changed, 0 insertions, 8 deletions
diff --git a/pkg/api/handlers/libpod/secrets.go b/pkg/api/handlers/libpod/secrets.go
index 8708e630c..3ea2c2ea8 100644
--- a/pkg/api/handlers/libpod/secrets.go
+++ b/pkg/api/handlers/libpod/secrets.go
@@ -1,9 +1,7 @@
package libpod
import (
- "encoding/json"
"net/http"
- "reflect"
"github.com/containers/podman/v4/libpod"
"github.com/containers/podman/v4/pkg/api/handlers/utils"
@@ -20,12 +18,6 @@ func CreateSecret(w http.ResponseWriter, r *http.Request) {
decoder = r.Context().Value(api.DecoderKey).(*schema.Decoder)
)
- decoder.RegisterConverter(map[string]string{}, func(str string) reflect.Value {
- res := make(map[string]string)
- json.Unmarshal([]byte(str), &res)
- return reflect.ValueOf(res)
- })
-
query := struct {
Name string `schema:"name"`
Driver string `schema:"driver"`