Skip to content

insecure-skip-tls-verify is Ignored in Kube Config #7

@runewake2

Description

@runewake2

When using var k8sApi = k8s.Config.defaultClient(); to get the default client, if the users .kube/config file includes a context with insecure-skip-tls-verify the certificate-authority is not necessarily going to be present. See example below:

- cluster:
    insecure-skip-tls-verify: true
    server: https://127.0.0.1:443
  name: my-cluster

In these cases the call to defaultClient() fails with the following error:

Uncaught Error: clusters[0].cluster.[certificate-authority-data, certificate-authority] is missing

This is trigged by Config Types validation code which tests for a certificate authority even if insecure-skip-tls-verify is set to true. Source

This prevents using this library even if the currently set context does provide a context-authority since all context configurations are validated during the iteration.

I would like to be able to connect to some clusters using the insecure flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions