use yaml v3 UnmarshalYAML (#587)

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero 2022-12-19 05:40:07 +08:00 committed by GitHub
parent 36c91c5427
commit 8ce539f4de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -3103,9 +3103,9 @@ func (p SubHelmfileSpec) MarshalYAML() (interface{}, error) {
// UnmarshalYAML will unmarshal the helmfile yaml section and fill the SubHelmfileSpec structure
// this is required to keep allowing string scalar for defining helmfile
func (hf *SubHelmfileSpec) UnmarshalYAML(unmarshal func(interface{}) error) error {
func (hf *SubHelmfileSpec) UnmarshalYAML(value *yaml.Node) error {
var tmp interface{}
if err := unmarshal(&tmp); err != nil {
if err := value.Decode(&tmp); err != nil {
return err
}
@ -3120,7 +3120,7 @@ func (hf *SubHelmfileSpec) UnmarshalYAML(unmarshal func(interface{}) error) erro
Environment SubhelmfileEnvironmentSpec `yaml:",inline"`
}
if err := unmarshal(&subHelmfileSpecTmp); err != nil {
if err := value.Decode(&subHelmfileSpecTmp); err != nil {
return err
}
hf.Path = subHelmfileSpecTmp.Path