terraform-provider-kubernetes icon indicating copy to clipboard operation
terraform-provider-kubernetes copied to clipboard

Autogenerated documentation is misleading.

Open w3dev-dk opened this issue 2 years ago • 1 comments

Affected Resource(s)

  • kubernetes_cluster_role
  • kubernetes_role

Terraform sample

resource "kubernetes_cluster_role" "some-name" {
  metadata {
    name = "some-name"
  }
  
  rule {
    api_groups = ["kafka.strimzi.io"]
    resources = ["ResourceAll"]
    verbs = ["VerbAll"]
  }
}

Expected Behavior

ResourceAll and VerbAll should represent ALL resources and verbs aka * like documented here: https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/cluster_role#resources

Actual Behavior

Grants access to the string literal of ResourceAll and/or VerbAll instead of expand to *. The issue is that the documentation is autogenerated from https://github.com/apprenda-kismatic/kubernetes-rbac/blob/master/api/types.go#L38 which is valid for programming but not for terraform and text based manifests.

w3dev-dk avatar Jun 14 '22 07:06 w3dev-dk

Hello! Thank you for opening this issue. We should fix the documentation for this.

It has actually been fixed in the latest Kubernetes Documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#policyrule-v1-rbac-authorization-k8s-io

BBBmau avatar Jun 15 '22 18:06 BBBmau

I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Feb 09 '23 02:02 github-actions[bot]