databricks / click

The "Command Line Interactive Controller for Kubernetes"
Apache License 2.0
1.49k stars 84 forks source link

Invalid certificate or key data when selecting context #29

Closed lbolla closed 2 years ago

lbolla commented 6 years ago
[none] [none] [none] > ctx ldc
Private key data was invalid: ()
[Warning] Couldn't find/load context ldc, now no current context.  Error: Failed to get config: Invalid certificate or key data for context: ldc

When using kubectl config use-context all works fine.

mbovo commented 6 years ago

Same issue here,

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.10.10.10:6443
  name: itpv-1
contexts:
- context:
    cluster: itpv-1
    user: admin
  name: admin@itpv-1
current-context: admin@itpv-1
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED`
Ljzn commented 6 years ago

my issue:

[Warning] Couldn't find/load context gke-a_cluster-1, now no current context.  Error: Failed to get config: Invalid context gke_inblockchain-back-garden_asia-east1-a_cluster-1.  Each user must have either a token, a username AND password, or a client-certificate AND a client-key.
den-is commented 6 years ago

same here two local on prem. clusters kubectl kube-shell etc are working just fine

kubectl config view
apiVersion: v1
clusters:
- cluster:
    server: ""
  name: ""
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.66.150.42:6443
  name: devk8s
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.55.11.104:6443
  name: sandbox
contexts:
- context:
    cluster: sandbox
    user: superadmin
  name: default
- context:
    cluster: devk8s
    user: admin@devk8s
  name: mydev
current-context: mydev
kind: Config
preferences: {}
users:
- name: admin@devk8s
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
- name: superadmin
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
[none] [none] [none] > contexts
default
mydev
[none] [none] [none] > context mydev
Private key data was invalid: ()
[Warning] Couldn't find/load context mydev, now no current context.  Error: Failed to get config: Invalid certificate or key data for context: mydev
[none] [none] [none] >
nicklan commented 2 years ago

This should be fixed by the new reqwest client. Please test and open a new issue if you have any trouble.