Can't read kube config

Good afternoon
Help please
I downloaded the latest version of Lens for Windows and it cannot read the kube config, there is this error in the log “No valid user object provided in kubeconfig for context”. Although everything works from the kubectl command line

Here is an excerpt from the log:

2024-11-18T09:55:57.052Z debug: 	[CLOUD-SYNC-REPORTER]: [CLOUD-PROVIDER-SYNC] has cloud provider clis: 
2024-11-18T09:55:57.067Z debug: 	[KUBECONFIG-SYNC]: file changed
2024-11-18T09:55:57.118Z debug: 	[KUBECONFIG-SYNC]: context failed validation: Error: No valid user object provided in kubeconfig for context 'my-context'
2024-11-18T09:55:57.119Z debug: 	[KUBECONFIG-SYNC]: File now has 0 entries
2024-11-18T09:55:57.119Z debug: 	[KUBECONFIG-SYNC]: Finished computing diff
2024-11-18T09:55:58.408Z info: 	[CREATE-ELECTRON-WINDOW]: Window "first-application-window" loaded
2024-11-18T09:56:00.744Z info: 	[RUN-MANY-PERFORMANCE-LOGGING]: Running runnables for "after-application-is-loaded-injection-token" took 3813.93 ms.

example kube config:

apiVersion: v1
clusters:
- cluster:
    server: https://test.io:6443
  name: staging
users:
- name: a.larchenko
  user:
    auth-provider:
      config:
        client-id: kubernetes
        client-secret: 
        id-token: my token
        idp-issuer-url: https://auth.io/dex
        refresh-token: my refresh token
      name: oidc
contexts:
- context:
    cluster: staging
    namespace: test
    user: a.larchenko
  name: my-context
current-context: my-context
kind: Config
preferences: {}

Would you be able to share the kubeconfig in question?

Yes, sure)
Updated the question

is “client-secret” really that format? If so that is our problem thanks for pointing this out

Yes, this format works correctly via the command line
I found what exactly was breaking the parsing of the config: an empty client-secret. If you specify empty quotes in it, then lens works correctly

Has error parsing

...
users:
- name: a.larchenko
  user:
    auth-provider:
      config:
        client-id: kubernetes
        client-secret: 
...

Works correctly

...
users:
- name: a.larchenko
  user:
    auth-provider:
      config:
        client-id: kubernetes
        client-secret: ""
...

Yes that is what I have found too. We of course should support anything that kubectl supports. Will make an internal ticket.

1 Like