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

Helm Release Name not Validated on Plan #1224

Closed
BenB196 opened this issue Aug 15, 2023 · 1 comment · Fixed by #1228
Closed

Helm Release Name not Validated on Plan #1224

BenB196 opened this issue Aug 15, 2023 · 1 comment · Fixed by #1228
Labels

Comments

@BenB196
Copy link

BenB196 commented Aug 15, 2023

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.5.5
Provider version: 2.9.0
Kubernetes version: 1.25.12

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "this" {
  chart      = "raw"
  name       = "this-helm-release-name-is-longer-than-53-characters-long"
  namespace  = "default"
  repository = "https://dysnix.github.io/charts"
  version    = "0.3.1"

  values = [""]
}

Debug Output

NOTE: In addition to Terraform debugging, please set HELM_DEBUG=1 to enable debugging info from helm.

Panic Output

N/A

Steps to Reproduce

  1. terraform plan
  2. terraform apply

Expected Behavior

I expect to see the plan fail with the error:

Error: release name "this-helm-release-name-is-longer-than-53-characters-long": invalid release name, must match regex ^[a-z0-9]([-a-z09]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ and the length must not be longer than 53

Actual Behavior

The plan succeeds, but the apply fails with the above error.

Important Factoids

Looking through the code for helm_release I didn't see any validation functionality related to checking the resource name, so I think there just doesn't exist any provider based validation on this.

This issue isn't too bad with static release names, but can become a problem when you have 3rd parties passing names via variables.

References

N/A

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
@BenB196 BenB196 added the bug label Aug 15, 2023
@arybolovlev
Copy link
Contributor

Hi @BenB196,

Thank you for reporting this issue! I will refer to this issue in the PR that fixes this and this issue will be automatically closed once the PR is merged. It will be available in the upcoming release.

Please keep an eye on the release notes.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants