Skip to content

Multiple cluster_role_selectors are ignored #1360

@fmulero

Description

@fmulero

Terraform Version, Provider Version and Kubernetes Version

Terraform version: 1.0.0
Kubernetes provider version: 2.3.2
Kubernetes version: 1.18 (EKS)

Affected Resource(s)

resource "kubernetes_cluster_role" "example" {

  metadata {
    name   = "example"
  }

  aggregation_rule {
    cluster_role_selectors {
      match_labels = {
        "rbac.authorization.k8s.io/aggregate-to-view" = "true"
      }
    }
    cluster_role_selectors {
      match_labels = {
        "example.io/aggregregate-to-app" = "true"
      }
    }
  }
}

Expected Behavior

A role with the following aggregation rule is created:

aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.authorization.k8s.io/aggregate-to-view: 'true'
    - matchLabels:
        example.io/aggregregate-to-app: 'true'

Actual Behavior

The second cluster_role_selectors is ignored and only the first match_label rule is created (the same happens using match_expressions )

aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.authorization.k8s.io/aggregate-to-view: 'true'

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions