Skip to content

Commit

Permalink
fix: Adds namespace creation dependency for role binding resource (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Santana <[email protected]>
  • Loading branch information
csantanapr authored Mar 30, 2023
1 parent de75b3f commit ae41721
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ resource "kubernetes_role_binding_v1" "this" {

metadata {
name = "${coalesce(var.role_name, var.name)}-${each.key}"
namespace = each.key
namespace = try(each.value.create, true) ? kubernetes_namespace_v1.this[each.key].metadata[0].name : each.key
annotations = var.annotations
labels = var.labels
}
Expand All @@ -364,7 +364,7 @@ resource "kubernetes_role_binding_v1" "this" {
kind = "Group"
name = var.name
api_group = "rbac.authorization.k8s.io"
namespace = each.key
namespace = try(each.value.create, true) ? kubernetes_namespace_v1.this[each.key].metadata[0].name : each.key
}
}

Expand Down

0 comments on commit ae41721

Please sign in to comment.