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

fix: Ensure isra_tag_values can be tried before defaulting to cluster_name on Karpenter module #2631

Conversation

joshuapare
Copy link
Contributor

@joshuapare joshuapare commented May 25, 2023

Description

"Coalescelist" uses the first non-empty list. Since var.cluster_name defaults to an empty string, which creates a single-element array with an empty string as the only element (as well as it is almost always specified by the user for other resources such as the queue name and other cluster-named resources in this module) the custom tag values never take affect.

https://developer.hashicorp.com/terraform/language/functions/coalescelist

Motivation and Context

Without this change, passing in the cluster name and specifying custom tag values is not possible. this change is necessary to be able to share resources between clusters. For example, we use the same set of subnets for multiple development clusters with karpenter.sh/discovery/{cluster_name} = "shared" on the subnets for discovery.

Breaking Changes

This does not introduce a breaking change.

How Has This Been Tested?

  • I have manually installed this updated module into our playground account with success.

@joshuapare joshuapare changed the title bug: karpenter module never uses custom irsa tags bug: karpenter module never uses custom irsa tag values May 25, 2023
@joshuapare joshuapare changed the title bug: karpenter module never uses custom irsa tag values fix: karpenter module never uses custom irsa tag values May 25, 2023
@joshuapare joshuapare changed the title fix: karpenter module never uses custom irsa tag values fix: Karpenter module never uses custom irsa tag values May 25, 2023
@bryantbiggs bryantbiggs changed the title fix: Karpenter module never uses custom irsa tag values fix: Ensure isra_tag_values can be tried before defaulting to clutser_name on Karpenter module May 30, 2023
Copy link
Member

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

good catch, thank you!

@bryantbiggs bryantbiggs changed the title fix: Ensure isra_tag_values can be tried before defaulting to clutser_name on Karpenter module fix: Ensure isra_tag_values can be tried before defaulting to cluster_name on Karpenter module May 30, 2023
@bryantbiggs bryantbiggs merged commit 6c56e2a into terraform-aws-modules:master May 30, 2023
18 checks passed
antonbabenko pushed a commit that referenced this pull request May 30, 2023
### [19.15.2](v19.15.1...v19.15.2) (2023-05-30)

### Bug Fixes

* Ensure `isra_tag_values` can be tried before defaulting to `cluster_name` on Karpenter module ([#2631](#2631)) ([6c56e2a](6c56e2a))
@antonbabenko
Copy link
Member

This PR is included in version 19.15.2 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2023
@joshuapare joshuapare deleted the fix-karpenter-module-tag-values branch July 3, 2023 00:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants