Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 clusterctl: improve connection error messages #2526

Conversation

fabriziopandini
Copy link
Member

@fabriziopandini fabriziopandini commented Mar 4, 2020

What this PR does / why we need it:
This PR improves error messages for most common problems when connecting to kubernetes:

Missing kubeconfig now returns:

invalid kubeconfig file; clusterctl requires a valid kubeconfig file to connect to the management cluster: no configuration has been provided

(the last bit is the error from k8s.io/client-go/tools/clientcmd)

Existing kubeconfig, but connection errors:

failed to connect to the management cluster: Get https://127.0.0.1:32784/api?timeout=32s: dial tcp 127.0.0.1:32784: connect: connection refused

(the last bit is the error from controller runtime client)

Which issue(s) this PR fixes :
Fixes #2515

/area clusterctl
/assign @wfernandes @detiber

@k8s-ci-robot k8s-ci-robot added area/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 4, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 4, 2020
@vincepri
Copy link
Member

vincepri commented Mar 4, 2020

/milestone v0.3.0-rc.3

@k8s-ci-robot k8s-ci-robot added this to the v0.3.0-rc.3 milestone Mar 4, 2020
@wfernandes
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, wfernandes

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 42ef987 into kubernetes-sigs:master Mar 4, 2020
@fabriziopandini fabriziopandini deleted the clusterctl-improve-error-msg branch March 5, 2020 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/clusterctl Issues or PRs related to clusterctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clusterctl init without a kubernetes cluster returns cryptic error
5 participants