-
Notifications
You must be signed in to change notification settings - Fork 107
Parsing kubeconfig's certificate-authority-data fails #81
Comments
What yaml library are you using? Can you share a reproducible test case? |
see
I will provide an example config later this weekend. |
I am using go-yaml/yaml (which is the same repo as the OP, but not using An example YAML file which fails (though it really only matters that apiVersion: v1
clusters:
- cluster:
certificate-authority-data: Qk9HVVMgQ2VydCBBdXRob3JpdHkgRGF0YQ==
server: https://192.168.101.101
name: gke_PROJECTID
contexts:
- context:
cluster: gke_PROJECTID
user: gke_PROJECTID
name: gke_PROJECTID
current-context: gke_PROJECTID
kind: Config
preferences: {}
users:
- name: gke_PROJECTID
user:
auth-provider:
config:
access-token: ya29.REMOVED
cmd-args: config config-helper --format=json
cmd-path: /home/MY-USER/google-cloud-sdk/bin/gcloud
expiry: 2017-07-23T17:07:48Z
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp (note that the cert-authority-data is bogus but correctly-encoded base64 data) |
It is probably best to simply recommend that users use github.com/ghodss/yaml instead, which does parse correctly. |
I'd recommend using github.com/ghodss/yaml if you want this conversion. As you may have noticed, this client doesn't support things like auth providers too. Full kubeconfig loading is black magic that's best left to kubectl. I'd recommend shelling out to |
certificate-authority-data (k8s. Cluster.CertificateAuthorityData) normally is a base64 string, but the current code somehow tries to translate it into
[]uint8
:The text was updated successfully, but these errors were encountered: