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: unable to have more than one fargate profile #1532

Closed
wants to merge 1 commit into from
Closed

fix: unable to have more than one fargate profile #1532

wants to merge 1 commit into from

Conversation

ehrenkret
Copy link

PR o'clock

Description

Resolves issue #1245

local.fargate_profiles_expanded is always empty when local.create_eks is false so the ternary operator here can be omitted.

local.create_eks is defined as var.create_eks && length(var.fargate_profiles) > 0

local.fargate_profiles_expanded is defined as { for k, v in var.fargate_profiles : k => merge( v, { tags = merge(var.tags, lookup(v, "tags", {})) }, ) if var.create_eks }

If var.create_eks is false, then local.fargate_profiles_expanded will have all entries filtered out by the conditional in the for expression.
If var.fargate_profiles is length 0, then local.fargate_profiles_expanded will have no entries to iterate over in the for expression.

Checklist

`local.fargate_profiles_expanded` is always empty when `local.create_eks` is false so the ternary operator here can be omitted.

`local.create_eks` is defined as `var.create_eks && length(var.fargate_profiles) > 0`

`local.fargate_profiles_expanded` is defined as `{ for k, v in var.fargate_profiles : k => merge(
    v,
    { tags = merge(var.tags, lookup(v, "tags", {})) },
  ) if var.create_eks }`

If `var.create_eks` is false, then `local.fargate_profiles_expanded` will have all entries filtered out by the conditional in the for expression.
If `var.fargate_profiles` is length 0, then `local.fargate_profiles_expanded` will have no entries to iterate over in the for expression.
@daroga0002
Copy link
Contributor

daroga0002 commented Sep 6, 2021

fargate_profiles_expanded = { for k, v in var.fargate_profiles : k => merge(
v,
{ tags = merge(var.tags, lookup(v, "tags", {})) },
) if var.create_eks }

@antonbabenko
Copy link
Member

Fixed in #1583 (9885ac0)

@antonbabenko
Copy link
Member

v17.19.0 has been just released with this fix.

@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 Nov 12, 2022
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.

3 participants