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

status: Explicitly state that the cluster does not exist #6438

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

tstromberg
Copy link
Contributor

While debugging a local integration test failure that said the cluster status was "", I dug in and noticed that "minikube status" on a nonexistent cluster emits no error:

host: 
kubelet: 
apiserver: 
kubeconfig: 

This PR changes the behavior to emit an error to stderr, and populate the fields with "Nonexistent":

E0130 14:43:04.992476    7478 status.go:98] The "minikube" cluster does not exist!
host: Nonexistent
kubelet: Nonexistent
apiserver: Nonexistent
kubeconfig: Nonexistent

With -o json, it emits:

E0130 14:43:07.520741    7534 status.go:98] The "minikube" cluster does not exist!
{"Host":"Nonexistent","Kubelet":"Nonexistent","APIServer":"Nonexistent","Kubeconfig":"Nonexistent"} 

@k8s-ci-robot k8s-ci-robot added 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 Jan 30, 2020
@tstromberg tstromberg changed the title Explicitly say that a cluster is nonexistent status: Explicitly state that the cluster does not exist Jan 30, 2020
@tstromberg
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jan 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tstromberg

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2020
@codecov-io
Copy link

Codecov Report

Merging #6438 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6438      +/-   ##
==========================================
- Coverage   37.68%   37.64%   -0.04%     
==========================================
  Files         128      128              
  Lines        8654     8662       +8     
==========================================
  Hits         3261     3261              
- Misses       4970     4978       +8     
  Partials      423      423
Impacted Files Coverage Δ
cmd/minikube/cmd/status.go 26.31% <0%> (-2.42%) ⬇️

@minikube-pr-bot
Copy link

All Times minikube: [ 92.984026 98.199648 95.280520]
All Times Minikube (PR 6438): [ 94.672726 96.674145 97.683283]

Average minikube: 95.488065
Average Minikube (PR 6438): 96.343385

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6438) |
+----------------------+-----------+--------------------+
| minikube v           |  0.316215 |           0.300070 |
| Creating kvm2        | 19.843634 |          20.480782 |
| Preparing Kubernetes | 49.317161 |          49.315685 |
| Pulling images       |  3.601241 |           3.723885 |
| Launching Kubernetes | 19.623075 |          19.907964 |
| Waiting for cluster  |  2.730142 |           2.560205 |
+----------------------+-----------+--------------------+

@sharifelgamal
Copy link
Collaborator

is the line printed to stderr going to break stuff ingesting the json output?

@tstromberg
Copy link
Contributor Author

is the line printed to stderr going to break stuff ingesting the json output?

It could: but that's fine with me: stderr is never designed to be parsed, as it may always contain a random unrelated error message.

@tstromberg tstromberg merged commit 02902f7 into kubernetes:master Jan 31, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

5 participants