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

Support forcing type on Helm chart set attribute #943

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

wjam
Copy link
Contributor

@wjam wjam commented Sep 9, 2022

What does this PR do?

🛑 Please open an issue first to discuss any significant work and flesh out details/direction - we would hate for your time to be wasted.
Consult the CONTRIBUTING guide for submitting pull-requests.

Allow the user to set the type attribute within the set block of the helm_release resource if needed.

Motivation

More

  • Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
  • Yes, I have added a new example under examples to support my PR
  • Yes, I have created another PR for add-ons under add-ons repo (if applicable)
  • Yes, I have updated the docs for this feature
  • Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs require a new example and/or doc page. In general:

  • Use an existing example when possible to demonstrate a new addons usage
  • A new docs page under docs/add-ons/* is required for new a new addon

For Moderators

  • E2E Test successfully complete before merge?

Additional Notes

I've updated the eks-cluster-with-new-vpc to prove it works, but noticed that cert_manager_helm_config is using set_values to configure Helm attributes - I don't think set_values works?

Certain values in a Kubernetes resource _must_ be a string and
Kubernetes will complain if the value is of another type rather than
automatically convert it into a string. An example of this problem would
be the value `true` on a `Pod` label - in YAML, this must be `"true"`
for Kubernetes to be satisfied.

This adds a new optional attribute for the `set` element of all
`*_helm_config` variables which allows the user to switch from the
default behaviour of handling the `value` - `auto` - to `string`, which
will force the `value` to be handled as text rather than a boolean or
number.

Fixes aws-ia#942
@wjam wjam temporarily deployed to EKS Blueprints Test September 9, 2022 11:15 Inactive
Copy link
Contributor

@bryantbiggs bryantbiggs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@bryantbiggs bryantbiggs merged commit 21b9da8 into aws-ia:main Sep 9, 2022
@@ -43,6 +43,7 @@ resource "helm_release" "addon" {
content {
name = each_item.value.name
value = each_item.value.value
type = try(each_item.value.type, null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be string by default... without it, many places fail

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an optional argument so null is what should be used to default to the resource's default value https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release#type

allamand pushed a commit to allamand/terraform-aws-eks-blueprints that referenced this pull request Dec 15, 2022
Certain values in a Kubernetes resource _must_ be a string and
Kubernetes will complain if the value is of another type rather than
automatically convert it into a string. An example of this problem would
be the value `true` on a `Pod` label - in YAML, this must be `"true"`
for Kubernetes to be satisfied.

This adds a new optional attribute for the `set` element of all
`*_helm_config` variables which allows the user to switch from the
default behaviour of handling the `value` - `auto` - to `string`, which
will force the `value` to be handled as text rather than a boolean or
number.

Fixes aws-ia#942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set some boolean values on addon Helm configuration
3 participants