terraform-provider-helm
terraform-provider-helm copied to clipboard
Fix CRD template with multi docs and output CRDs as a separate output
Description
This change fixes a long running issue and implements a related feature at the same time. The issue #782 describes the weird behavior in the Helm template datasource when a Helm chart includes a crds directory, and the CRDs start with a multidoc yaml annotation ---
. The current version of this provider is not able to deal with this, due to the way Helm works. Helm treats yaml in the templates and crds directory differently. Any extra multidoc annotation in the templates directory is sanitized and removed, bu that is not the case for yaml in the crds directory.
This PR changes to get the CRDs from the chart instead of having the template command do it. Then the CRDs are appended before computing the output parameters. This also enables the possibility to output the CRDs separatly from the manifests. An additional change is the addition of two outputs from the datasource which mimic the manifest output but only include the CRDs.
Acceptance tests
- [x] Have you added an acceptance test for the functionality being added?
Release Note
Release note for CHANGELOG:
* Add `crds` and `crd` outputs to `helm_template` datasource
* Fix templating of crds in `helm_template` datasource when CRDs contain multidoc yaml annotations
References
Fixes #791 #782
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
@jrhouston this change became a bit bigger than I wanted it to be, but the refactoring was necessary to be able to do the separate CRD outputs.
Any update on getting this merged?
Ping for the new year.
Any updates on when this will be merged? Thanks!
@jrhouston could we get this merged?
@phillebaba @jrhouston any chance to get this merged?
I think you'll be doing the community a huge favour - currently, there is no way to selectively install only CRDs and the landscape with helm charts is a mess regarding CRDs not being updated by helm.
Hello Mr.@jrhouston. Could you please take a look at this feature request? I am sure the community would appreciate it.
Hi @jrhouston , I am one of the many people looking for this feature. Can you please give us an update on the state of this PR? Does it need some code changes? Is it ready to merge in? I would love to do the work to get this resolved and into the provider.