From 36a0ed9702bf4e6ef50650404c838a26f13ba879 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Fri, 14 Feb 2020 15:46:18 -0500 Subject: 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 --- pkg/api/handlers/libpod/pods.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg') 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 } -- cgit v1.2.3-54-g00ecf