Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix defaultVariablePattern for period #87

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix defaultVariablePattern for period
  • Loading branch information
hori-ryota committed Aug 3, 2016
commit 05dca01a4cf85f884d26ac90e2eb238ec275de18
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