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 ClusterRole aggregation_rule.cluster_role_selector] not found #86

Merged
merged 1 commit into from Oct 5, 2021

Conversation

sl1pm4t
Copy link
Owner

@sl1pm4t sl1pm4t commented Oct 5, 2021

Fixes error:

3:43PM Warn | excluding attribute [kubernetes_cluster_role.aggregation_rule.cluster_role_selector] not found in Terraform schema  field=ClusterRole.AggregationRule.ClusterRoleSelectors name=monitoring type=kubernetes_cluster_role
resource "kubernetes_cluster_role" "monitoring" {
  metadata {
    name = "monitoring"
  }

  aggregation_rule {}
}

based on input YAML:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: monitoring
aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.example.com/aggregate-to-monitoring: "true"
rules: [] # The control plane automatically fills in the rules

After this fix, outputs as:

resource "kubernetes_cluster_role" "monitoring" {
  metadata {
    name = "monitoring"
  }
  aggregation_rule {
    cluster_role_selectors {
      match_labels = { "rbac.example.com/aggregate-to-monitoring" = "true" }
    }
  }
}

Closes #81

@sl1pm4t sl1pm4t merged commit 6ef6d85 into master Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing ClusterRole.AggregationRule
1 participant