banzaicloud / terraform-provider-k8s

Kubernetes Terraform provider with support for raw manifests
https://registry.terraform.io/providers/banzaicloud/k8s
MIT License
135 stars 30 forks source link

Resource names must not contain colons #17

Closed tboeghk closed 4 years ago

tboeghk commented 4 years ago

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.

bonifaido commented 4 years ago

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