Skip to content

Commit e0432ec

Browse files
committed
fix: vars expansion
1 parent 118b4ca commit e0432ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/config/vars.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ package config
33
import (
44
"bytes"
55
"encoding/json"
6+
"regexp"
67

78
plugin_util "github.com/outblocks/outblocks-plugin-go/util"
89
)
910

11+
var quoteValues = regexp.MustCompile(`(\s*-\s+|\S:\s+)(\$\{var\.[^}]+})`)
12+
1013
type YAMLEvaluator struct {
1114
*plugin_util.BaseVarEvaluator
1215
}
@@ -21,7 +24,9 @@ func NewYAMLEvaluator(vars map[string]interface{}) *YAMLEvaluator {
2124
}
2225

2326
func (e *YAMLEvaluator) Expand(input []byte) ([]byte, error) {
27+
input = quoteValues.ReplaceAll(input, []byte(`$1"$2"`))
2428
format, _, err := e.ExpandRaw(input)
29+
2530
return format, err
2631
}
2732

0 commit comments

Comments
 (0)