summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2020-02-14 15:46:18 -0500
committerMatthew Heon <matthew.heon@pm.me>2020-02-14 16:06:20 -0500
commit36a0ed9702bf4e6ef50650404c838a26f13ba879 (patch)
tree316a75c4cc66f02fed91cb40918e6396b314bc54 /pkg/api
parent97fdfd0a80b14b83abca3d8e0aa1b5c64ceac79b (diff)
downloadpodman-36a0ed9702bf4e6ef50650404c838a26f13ba879.tar.gz
podman-36a0ed9702bf4e6ef50650404c838a26f13ba879.tar.bz2
podman-36a0ed9702bf4e6ef50650404c838a26f13ba879.zip
Rework label parsing
We attempted to share all logic for parsing labels and environment variables, which on the surface makes lots of sense (both are formatted key=value so parsing logic should be identical) but has begun to fall apart now that we have added additional logic to environment variable handling. Environment variables that are unset, for example, are looked up against environment variables set for the process. We don't want this for labels, so we have to split parsing logic. Fixes #3854 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/pods.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go
index e9297d91b..d043b1204 100644
--- a/pkg/api/handlers/libpod/pods.go
+++ b/pkg/api/handlers/libpod/pods.go
@@ -42,7 +42,8 @@ func PodCreate(w http.ResponseWriter, r *http.Request) {
}
if len(input.Labels) > 0 {
- if err := parse.ReadKVStrings(labels, []string{}, input.Labels); err != nil {
+ labels, err = parse.GetAllLabels([]string{}, input.Labels)
+ if err != nil {
utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
return
}