Fixing downloader plugin error handling

Signed-off-by: Zoran Krleza <zoran.krleza@true-north.hr>
pull/10832/head
Zoran Krleza 3 years ago
parent 12f1bc0acd
commit 06c39c8079

@ -75,6 +75,9 @@ func (opts *Options) MergeValues(p getter.Providers) (map[string]interface{}, er
for _, value := range opts.FileValues {
reader := func(rs []rune) (interface{}, error) {
bytes, err := readFile(string(rs), p)
if err != nil {
return nil, err
}
return string(bytes), err
}
if err := strvals.ParseIntoFile(value, base, reader); err != nil {
@ -117,5 +120,8 @@ func readFile(filePath string, p getter.Providers) ([]byte, error) {
return ioutil.ReadFile(filePath)
}
data, err := g.Get(filePath, getter.WithURL(filePath))
if err != nil {
return nil, err
}
return data.Bytes(), err
}

Loading…
Cancel
Save