terraform-provider-helm icon indicating copy to clipboard operation
terraform-provider-helm copied to clipboard

Fix CRD template with multi docs and output CRDs as a separate output

Open phillebaba opened this issue 3 years ago • 9 comments

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

phillebaba avatar Oct 29 '21 09:10 phillebaba

@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.

phillebaba avatar Oct 29 '21 09:10 phillebaba

Any update on getting this merged?

phillebaba avatar Dec 15 '21 09:12 phillebaba

Ping for the new year.

phillebaba avatar Jan 21 '22 14:01 phillebaba

Any updates on when this will be merged? Thanks!

nicoodle avatar Jan 24 '22 17:01 nicoodle

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Mar 12 '22 17:03 hashicorp-cla

@jrhouston could we get this merged?

phillebaba avatar Apr 28 '22 13:04 phillebaba

@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.

MatthiasWinzeler avatar Jun 22 '22 17:06 MatthiasWinzeler

Hello Mr.@jrhouston. Could you please take a look at this feature request? I am sure the community would appreciate it.

aidanmelen avatar Jul 27 '22 02:07 aidanmelen

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.

robinkb avatar Aug 10 '22 08:08 robinkb