Skip to content

ketall can't be used with client.authentication.k8s.io/v1 #181

Open
@timebertt

Description

@timebertt

Describe the bug

When using a kubeconfig with credential plugins with API version client.authentication.k8s.io/v1, ketall fails with:

$ k get-all -n default
F1206 14:58:22.079749   53609 ket_all.go:34] fetch available group resources: discovery client: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1"
goroutine 1 [running]:
...

My kubeconfig looks like this and works with kubectl:

$ k config view --minify
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    extensions:
    - extension:
        gardenClusterIdentity: dev
        shootRef:
          name: tim-test
          namespace: garden-test
      name: client.authentication.k8s.io/exec
    server: https://api.tim-test.test.s.ske.eu01.onstackit.cloud
  name: garden-test--tim-test
contexts:
- context:
    cluster: garden-test--tim-test
    namespace: default
    user: garden-test--tim-test
  name: garden-test--tim-test
current-context: garden-test--tim-test
kind: Config
preferences: {}
users:
- name: garden-test--tim-test
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1
      args:
      - get-client-certificate
      command: kubectl-gardenlogin
      env: null
      installHint: Follow the instructions on https://github.com/gardener/gardenlogin#installation
        to install gardenlogin
      interactiveMode: IfAvailable
      provideClusterInfo: true

$ k get ns
NAME              STATUS   AGE
default           Active   251d
kube-node-lease   Active   251d
kube-public       Active   251d
kube-system       Active   251d

To Reproduce
Steps to reproduce the behavior:

  1. Get a kubeconfig with credentials plugin in client.authentication.k8s.io/v1, e.g. using gardenctl
  2. Run k get-all -n default

Expected behavior

ketall should also work with credentials plugins in client.authentication.k8s.io/v1

Screenshots

n/a

Desktop (please complete the following information):

  • output of ketall version --full:
ketall:     v1.3.8
platform:   darwin/arm64
git commit: bb67dbaa7f35189b26de7b6f83576de778338737
build date: 2021-08-14T19:29:22Z
go version: go1.16.7
compiler:   gc
  • OS: macOS 13.6

Additional context

n/a

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions