From abfb2c064ded02f7ee600d3715b183150e795a92 Mon Sep 17 00:00:00 2001 From: Anthony Poschen Date: Mon, 26 Oct 2020 15:56:18 +1100 Subject: [PATCH] Add support for empty strings in target elements and compact func. Signed-off-by: Anthony Poschen --- bake/bake.go | 3 +++ bake/hcl.go | 1 + 2 files changed, 4 insertions(+) diff --git a/bake/bake.go b/bake/bake.go index e5ee0ca9..a8c7c37f 100644 --- a/bake/bake.go +++ b/bake/bake.go @@ -526,6 +526,9 @@ func removeDupes(s []string) []string { if _, ok := seen[v]; ok { continue } + if v == "" { + continue + } seen[v] = struct{}{} s[i] = v i++ diff --git a/bake/hcl.go b/bake/hcl.go index 6f19390e..510d2e60 100644 --- a/bake/hcl.go +++ b/bake/hcl.go @@ -31,6 +31,7 @@ var ( "csvdecode": stdlib.CSVDecodeFunc, "coalesce": stdlib.CoalesceFunc, "coalescelist": stdlib.CoalesceListFunc, + "compact": stdlib.CompactFunc, "concat": stdlib.ConcatFunc, "contains": stdlib.ContainsFunc, "distinct": stdlib.DistinctFunc,