Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get exact chart version from helm_template #1441

Open
mxk opened this issue Jul 23, 2024 · 2 comments
Open

Get exact chart version from helm_template #1441

mxk opened this issue Jul 23, 2024 · 2 comments
Assignees

Comments

@mxk
Copy link

mxk commented Jul 23, 2024

Description

It is sometimes desirable to convert a Helm chart version specification, such as ^1.0.0 to an exact version. Currently helm_template just returns the original version value. My exact use case is installing cert-manager and needing to get the corresponding version for the CRDs URL. Alternatively, it would be nice to have a separate data resource for this that didn't have the overhead of rendering all the templates.

Potential Terraform Configuration

data "helm_template" "main" {
  name       = "cert-manager"
  repository = "https://charts.jetstack.io"
  chart      = "cert-manager"
  version    = "^1.0.0"
}

output "version" {
  version = data.helm_template.main.version # Want "1.15.1"
}

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
Copy link
Contributor

Thanks for opening an issue @mxk.

Alternatively, it would be nice to have a separate data resource for this that didn't have the overhead of rendering all the templates.

This is something that has come up before, where we could add a helm_release_metadata data source that would be equivalent to the helm get metadata command which returns the chart, version, appVersion, etc. I think this might be preferable to adding some kind of separate computed_version field for this use case.

@mxk
Copy link
Author

mxk commented Jul 24, 2024

I agree. The other downside of helm_template is that it stores the rendered templates in the state, which can be a lot of data. You can limit that with show_only, but it's kind of a hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants