Skip to content

Commit

Permalink
Fix bug rendering Helm v3 resources that include hooks (#1459)
Browse files Browse the repository at this point in the history
This bug caused any resource that includes a hook annotation to
be skipped, which is an unintended behavior change from the v2 SDK.
  • Loading branch information
lblackstone committed Feb 3, 2021
1 parent da2edfc commit 62f8055
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## HEAD (Unreleased)

- Fix bug rendering Helm v3 resources that include hooks (https://github.com/pulumi/pulumi-kubernetes/pull/1459)

## 2.7.8 (January 27, 2021)

- Update pulumi dependency to remove unused Go types (https://github.com/pulumi/pulumi-kubernetes/pull/1450)
Expand Down
8 changes: 7 additions & 1 deletion provider/pkg/provider/invoke_helm_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ func (c *chart) template() (string, error) {
if err != nil {
return "", pkgerrors.Wrap(err, "failed to create chart from template")
}
manifests := strings.Builder{}
manifests.WriteString(rel.Manifest)
for _, hook := range rel.Hooks {
manifests.WriteString("\n---\n")
manifests.WriteString(hook.Manifest)
}

return rel.Manifest, nil
return manifests.String(), nil
}

0 comments on commit 62f8055

Please sign in to comment.