Commit f881c81f
f881c81f1cdbMerged
Svyatoslav Dumchenko <[email protected]> · 4 years ago · 5 files · ~5 modified
Description
feat: allow to set values delimiters
Details
- Commit
- f881c81f1cdb
- Parent
- 871ada810ecf
pkg/release/values.gomodifiedView file
@@ -20,10 +20,12 @@
2020
2121
// ValuesReference is used to match source values file path and temporary.2222
type ValuesReference struct {23-
Src string `yaml:"src" json:"src"`24-
Dst string `yaml:"dst" json:"dst"`25-
Strict bool `yaml:"strict" json:"strict"`26-
Render bool `yaml:"render" json:"render"`23+
Src string `yaml:"src" json:"src"`24+
Dst string `yaml:"dst" json:"dst"`25+
DelimiterLeft string `yaml:"delimiter_left,omitempty" json:"delimiter_left,omitempty"`26+
DelimiterRight string `yaml:"delimiter_right,omitempty" json:"delimiter_right,omitempty"`27+
Strict bool `yaml:"strict" json:"strict"`28+
Render bool `yaml:"render" json:"render"`2729
}2830
2931
// UnmarshalYAML is used to implement Unmarshaler interface of gopkg.in/yaml.v3.@@ -132,10 +134,11 @@
132134
return err133135
}134136
137+
delimOption := template.SetDelimiters(v.DelimiterLeft, v.DelimiterRight)135138
if v.isURL() {136-
err = template.Tpl2yml(v.Dst, v.Dst, data, templater)139+
err = template.Tpl2yml(v.Dst, v.Dst, data, templater, delimOption)137140
} else {138-
err = template.Tpl2yml(v.Src, v.Dst, data, templater)141+
err = template.Tpl2yml(v.Src, v.Dst, data, templater, delimOption)139142
}140143
141144
if err != nil {pkg/template/gomplate_templater.gomodifiedView file
Loading diff…
pkg/template/no_templater.gomodifiedView file
Loading diff…
pkg/template/sprig_templater.gomodifiedView file
Loading diff…
pkg/template/tpl2yml.gomodifiedView file
Loading diff…