Skip to content

bug: Enhance the error message when an admin.kubeconfig already exists, but is corrupt  #2295

Closed
@apoorvajagtap

Description

Describe the bug

Recently I was performing a kcp startup, which failed with the following errors:

cannot create the 'admin.kubeconfig` file with an empty token for the shard-admin user

Later, I determined the issue was due to a pre-existing corrupt kubeconfig (did not have any token or context details for shard-admin user) at .kcp/admin.kubeconfig. After cleaning up .kcp, I re-ran go run ./cmd/kcp start, and it progressed well!

Would it be feasible to enhance the error message, when the admin.kubeconfig file already exists but does not have token details of the shard-admin user, rather than just stating that "it couldn't be created with empty token"? Let me know your thoughts!

If this seems like a useful change, I would like to work on it. Thanks!

Steps To Reproduce

  1. Remove the context and token details for shard-admin user in the .kcp/admin.kubeconfig.
  2. Build and start the kcp: go run ./cmd/kcp start

Expected Behaviour

A clearer message that indicates the missing context & token details from the existing kubeconfig.

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions