banzaicloud/terraform-provider-k8s

Resource names must not contain colons

tboeghk opened this issue · 1 comments

Describe the bug
Terraform runs into an error, if a Kubernetes resource name contains a colon (like metrics-server:system:auth-delegator).

Error: /usr/local/bin/kubectl kubectl --kubeconfig /Users/someuser/.kube/kube-config-accepted-manatee get --ignore-not-found clusterrolebindings/metrics-server%3Asystem%3Aauth-delegator exit status 1: error: invalid resource name "metrics-server%3Asystem%3Aauth-delegator": [may not contain '%']

Steps to reproduce the issue:
I wanted to deploy the Kubernetes metrics server via Terraform, which contained the ClusterRoleBinding below:

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: metrics-server:system:auth-delegator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:auth-delegator
subjects:
- kind: ServiceAccount
  name: metrics-server
  namespace: kube-system

Expected behavior
Resources should be created regardless of colons in their names.

Shouldn't be an issue anymore with the latest version, please try that.