From 05dca01a4cf85f884d26ac90e2eb238ec275de18 Mon Sep 17 00:00:00 2001 From: hori-ryota Date: Wed, 3 Aug 2016 18:47:11 +0900 Subject: [PATCH] Fix defaultVariablePattern for period --- util/util.go | 2 +- util/util_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/util.go b/util/util.go index 1a58a70..2f6408d 100644 --- a/util/util.go +++ b/util/util.go @@ -14,7 +14,7 @@ import ( var ( keyValuePattern = regexp.MustCompile(`^\s*(.+)\s*=\s*(.+)\s*$`) variablePattern = regexp.MustCompile(`\$\{([\w_-]+)\}`) - defaultVariablePattern = regexp.MustCompile(`\$\{([\w_-]+)\s*\|\s*([\w_-]+)\}`) + defaultVariablePattern = regexp.MustCompile(`\$\{([\w_-]+)\s*\|\s*([\w._-]+)\}`) ) func StringValueWithIndent(value interface{}, indent int) string { diff --git a/util/util_test.go b/util/util_test.go index 8255584..28eff7f 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -90,7 +90,7 @@ func TestMergeYamlWithDefaultParameters(t *testing.T) { yaml := ` nginx: - image: stormcat24/nginx:${NGINX_VERSION|feature} + image: stormcat24/nginx:${NGINX_VERSION|default-_4.9} ports: - 80:${NGINX_PORT|80} environment: @@ -99,7 +99,7 @@ func TestMergeYamlWithDefaultParameters(t *testing.T) { expect := ` nginx: - image: stormcat24/nginx:feature + image: stormcat24/nginx:default-_4.9 ports: - 80:8080 environment: