Skip to content

Commit

Permalink
Make v1 and v1beta policies mutually exclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
coord-e committed Oct 25, 2024
1 parent bcf7a28 commit 0db1769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/karpenter/controller_iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data "aws_iam_policy_document" "karpenter_controller_assume_role_policy" {
}

resource "aws_iam_role_policy" "karpenter_controller_v1_beta" {
count = var.v1beta ? 1 : 0
count = var.v1 ? 0 : 1
name = "KarpenterController-v1beta"
role = aws_iam_role.karpenter_controller.id
policy = data.aws_iam_policy_document.karpenter_controller_v1_beta.json
Expand Down
10 changes: 2 additions & 8 deletions modules/karpenter/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ variable "oidc_config" {
})
}

variable "v1beta" {
description = "Enable controller policy for v1beta resources (Karpenter >= 0.32.*)"
type = bool
default = true
}

variable "v1" {
description = "Enable controller policy for v1 resources (Karpenter >= 1.*)"
description = "Use controller policy for v1 resources (Karpenter >= 1.*)"
type = bool
default = true
default = false
}

variable "additional_node_role_arns" {
Expand Down

0 comments on commit 0db1769

Please sign in to comment.