From f39459680659971e0115ce7a0432b2a47ed5cb11 Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Mon, 19 Oct 2015 14:20:33 -0700 Subject: [PATCH] Avoid type error with `trim` `first` returns interface{}, not string, so it makes strings.Trim choke. The call to `or` returns a string in both cases, which `trim` can handle. --- nginx.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.tmpl b/nginx.tmpl index 0744941..c2d61ae 100644 --- a/nginx.tmpl +++ b/nginx.tmpl @@ -94,7 +94,7 @@ upstream {{ $host }} { {{ $default_server := index (dict $host "" $default_host "default_server") $host }} {{/* Get the VIRTUAL_PROTO defined by containers w/ the same vhost, falling back to "http" */}} -{{ $proto := or (trim (first (groupByKeys $containers "Env.VIRTUAL_PROTO"))) "http" }} +{{ $proto := trim (or (first (groupByKeys $containers "Env.VIRTUAL_PROTO")) "http") }} {{/* Get the first cert name defined by containers w/ the same vhost */}} {{ $certName := (first (groupByKeys $containers "Env.CERT_NAME")) }}