From 87b05847bfc3fadfa20690c6947fcd76c474b58d Mon Sep 17 00:00:00 2001 From: Chuanjian Wang Date: Sun, 7 May 2017 12:28:21 +0800 Subject: [PATCH] add template function getenv Signed-off-by: Chuanjian Wang --- controllers/nginx/pkg/template/template.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/nginx/pkg/template/template.go b/controllers/nginx/pkg/template/template.go index 91d7dcd10..edaa3456a 100644 --- a/controllers/nginx/pkg/template/template.go +++ b/controllers/nginx/pkg/template/template.go @@ -22,6 +22,7 @@ import ( "encoding/json" "fmt" "net" + "os" "os/exec" "strings" text_template "text/template" @@ -139,6 +140,7 @@ var ( "buildResolvers": buildResolvers, "isLocationAllowed": isLocationAllowed, "buildLogFormatUpstream": buildLogFormatUpstream, + "getenv": os.Getenv, "contains": strings.Contains, "hasPrefix": strings.HasPrefix, "hasSuffix": strings.HasSuffix,