Merge pull request #5101 from justinsb/fixlint_2

Fix unused error value
This commit is contained in:
Kubernetes Prow Robot
2023-03-20 12:23:07 -07:00
committed by GitHub
2 changed files with 10 additions and 4 deletions

View File

@@ -262,15 +262,18 @@ func (p *HelmChartInflationGeneratorPlugin) Generate() (rm resmap.ResMap, err er
// 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 *HelmChartInflationGeneratorPlugin) pullCommand() []string {

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 {