Skip to content

Commit

Permalink
Merge pull request #87 from hori-ryota/feature/fix-defaultvariablepat…
Browse files Browse the repository at this point in the history
…tern

Fix defaultVariablePattern for period
  • Loading branch information
stormcat24 committed Aug 3, 2016
2 parents 2954fb5 + 05dca01 commit 2151768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 2151768

Please sign in to comment.