Fix unused error value

The linter was complaining about err being unchecked.
This commit is contained in:
justinsb
2023-03-20 14:19:16 +00:00
parent a2e9682002
commit 317fcadccb
2 changed files with 10 additions and 4 deletions

View File

@@ -268,15 +268,18 @@ func (p *plugin) Generate() (rm resmap.ResMap, err error) {
// helm may produce messages to stdout before it
r := &kio.ByteReader{Reader: bytes.NewBufferString(string(stdout)), OmitReaderAnnotations: true}
nodes, err := r.Read()
if err != nil {
return nil, fmt.Errorf("error reading helm output: %w", err)
}
if len(nodes) != 0 {
rm, err = p.h.ResmapFactory().NewResMapFromRNodeSlice(nodes)
if err != nil {
return nil, fmt.Errorf("could not parse rnode slice into resource map: %w\n", err)
return nil, fmt.Errorf("could not parse rnode slice into resource map: %w", err)
}
return rm, nil
}
return nil, fmt.Errorf("could not parse bytes into resource map: %w\n", resMapErr)
return nil, fmt.Errorf("could not parse bytes into resource map: %w", resMapErr)
}
func (p *plugin) pullCommand() []string {