Skip to content

python kubeconfig loading doesn't match kubectl config loading... #445

Description

@brendandburns

I had a .kube/config file with duplicate clusters with the same name (but different information) in the config file, the three different entries each pointed to different clusters, two were dead, but one was alive (I had be repeatedly creating and deleting clusters)

kubectl command line happened to chose the working one and worked correctly.

python client library chose the first one in the file (which wasn't working) and failed.

This lead to a very confused experience until I figured out what was going on.

It will be difficult to emulate the kubectl parsing exactly, but we should detect duplicate entries and throw an exception. (and I would argue that kubectl probably should too)

This actually probably applies to all client libraries in different languages.

@mbohlool

Activity

  1. self-assigned this
    on Feb 15, 2018
  2. brendandburns commented on Feb 22, 2018

    @brendandburns
    ContributorAuthor
  3. roycaihw commented on Feb 22, 2018

    @roycaihw
    Member

    @brendandburns Totally agree. Just curious if kubectl in your test was picking the last one or behaving differently. I will open a PR to add the duplication detection.

  4. added a commit that references this issue on May 19, 2018
  5. added a commit that references this issue on Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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