mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 10:00:56 +00:00
handle helm output properly
This commit is contained in:
@@ -226,7 +226,17 @@ func (p *HelmChartInflationGeneratorPlugin) Generate() (resmap.ResMap, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return p.h.ResmapFactory().NewResMapFromBytes(stdout)
|
||||
rm, rmfErr := p.h.ResmapFactory().NewResMapFromBytes(stdout)
|
||||
if rmfErr == nil {
|
||||
return rm, nil
|
||||
}
|
||||
// try to remove the contents before first "---" because
|
||||
// helm may produce messages to stdout before it
|
||||
stdoutStr := string(stdout)
|
||||
if idx := strings.Index(stdoutStr, "---"); idx != -1 {
|
||||
return p.h.ResmapFactory().NewResMapFromBytes([]byte(stdoutStr[idx:]))
|
||||
}
|
||||
return nil, rmfErr
|
||||
}
|
||||
|
||||
func (p *HelmChartInflationGeneratorPlugin) getTemplateCommandArgs() []string {
|
||||
|
||||
Reference in New Issue
Block a user