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

Delete: output underlying status failure, better machine function names #7043

Merged
merged 2 commits into from
Mar 14, 2020

Conversation

tstromberg
Copy link
Contributor

Old UI if trying to delete a cluster while Docker is down:

❗  Unable to get the status of the minikube cluster.
🔥  Removing /Users/tstromberg/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.

It shows a warning, but no information as to why the status failed!

New UI if trying to delete a cluster while Docker is down:

❗  Unable to get host status for "minikube": state: docker inspect -f {{.State.Status}} minikube: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?: exit status 1
🔥  Removing /Users/tstromberg/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.

This also removes some technical debt discovered while trying to improve this message:

  • machine.DeleteHost now displays underlying status error in warning
  • kic.GetState error now includes command-line and output
  • Remove unused machine.List function
  • Renamed machine.CheckIfHostExistsAndLoad to machine.LoadHost
  • Renamed machine.Load to machine.LoadMachine (repetitive, but clearer vs LoadHost)
  • Renamed machine.GetHostStatus to machine.Status
  • Renamed machine.IsHostRunning to machine.IsRunning
  • Moved CreateSSHShell from machine.go to ssh.go

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 13, 2020
@tstromberg tstromberg changed the title Delete: output underlying status failure, refactor wordy code Delete: output underlying status failure, reduce machine tech debt Mar 13, 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 Mar 13, 2020
@tstromberg tstromberg changed the title Delete: output underlying status failure, reduce machine tech debt Delete: output underlying status failure, better machine function names Mar 13, 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 Mar 13, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

@codecov-io
Copy link

Codecov Report

Merging #7043 into master will decrease coverage by 0.35%.
The diff coverage is 34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7043      +/-   ##
==========================================
- Coverage   37.25%   36.89%   -0.36%     
==========================================
  Files         145      146       +1     
  Lines        9114     9099      -15     
==========================================
- Hits         3395     3357      -38     
- Misses       5295     5330      +35     
+ Partials      424      412      -12
Impacted Files Coverage Δ
cmd/minikube/cmd/config/profile_list.go 3.79% <0%> (ø) ⬆️
cmd/minikube/cmd/ssh.go 7.69% <0%> (ø) ⬆️
pkg/minikube/machine/cache_images.go 0% <0%> (ø) ⬆️
cmd/minikube/cmd/service_list.go 9.37% <0%> (ø) ⬆️
cmd/minikube/cmd/status.go 21.92% <0%> (ø) ⬆️
pkg/minikube/machine/machine.go 0% <0%> (-53.04%) ⬇️
cmd/minikube/cmd/pause.go 7.89% <0%> (ø) ⬆️
cmd/minikube/cmd/dashboard.go 1.63% <0%> (ø) ⬆️
pkg/minikube/cluster/ip.go 0% <0%> (ø) ⬆️
cmd/minikube/cmd/unpause.go 7.5% <0%> (ø) ⬆️
... and 15 more

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

Very nice clean up. Like to see more of these. Thank you

@medyagh medyagh merged commit 75ba4c2 into kubernetes:master Mar 14, 2020
@afbjorklund
Copy link
Collaborator

@medyagh : this PR broke the master, better to use "lgtm" than merge on these I think ?

https://github.com/kubernetes/minikube/runs/506958518

pkg/minikube/machine/machine.go:82:6: `machineDirs` is unused (deadcode)
func machineDirs(miniHome ...string) (dirs []string, err error) {
     ^
make[1]: *** [lint-ci] Error 1

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants