-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add spinner at preparing Kubernetes... #9855
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont know think we need to pass true or false to out.String
I think we only need it in out.Step (is there a reason we pass it to out.String ?
also consider using a Constant in the out package for a better code readability
for example
out.Step(style.Tip, false, "kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'")
can be chaged to
out.Step(style.Tip, out.Spinning, "kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'")
and for false it would
out.Step(style.Tip, out.NoSpinner, "kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'")
cmd/minikube/cmd/delete.go
Outdated
@@ -142,7 +142,7 @@ func runDelete(cmd *cobra.Command, args []string) { | |||
if purge && len(profilesToDelete) > 1 && !deleteAll { | |||
out.ErrT(style.Notice, "Multiple minikube profiles were found - ") | |||
for _, p := range profilesToDelete { | |||
out.Step(style.Notice, " - {{.profile}}", out.V{"profile": p.Name}) | |||
out.Step(style.Notice, out.NoSpinner, " - {{.profile}}", out.V{"profile": p.Name}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets move out.NoSpinner to style.NoSpinner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than adding an extra argument: the styles are designed to carry all information necessary for display. I would suggest adding a Spin
bool to style.Options
:
minikube/pkg/minikube/style/style.go
Line 37 in ead11c6
type Options struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! thanks @tstromberg from 42 files we reduce it to 6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for this PR ! looks good (literally Looks good)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alonyb, medyagh 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 |
/ok-to-test |
kvm2 Driver Times for Minikube (PR 9855): 29.7s 29.2s 28.2s Averages Time Per Log
|
kvm2 Driver Times for Minikube (PR 9855): 29.7s 28.8s 29.4s Averages Time Per Log
|
This PR is to #9091
Spinner was added in step:
This spinner works with this repo(module) forked in alonyb/spinner
PR of original repo is here
With this user feels more comfortable UI
In Windows was testing too and it works without problem
Next step:
Add spinner in another processes as (
Starting Control plane ...
andpulling docker image...
and others.)minikube start --output=json
output:
{"data":{"currentstep":"0","message":"minikube v1.15.1 on Darwin 10.15.7","name":"Initial Minikube Setup","totalsteps":"12"},"datacontenttype":"application/json","id":"7e20202a-babe-48e1-910d-6b525e8e7ef2","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"1","message":"Automatically selected the docker driver","name":"Selecting Driver","totalsteps":"12"},"datacontenttype":"application/json","id":"ba60dba1-7394-4a9b-88f4-9929f3f07580","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"3","message":"Starting control plane node minikube in cluster minikube","name":"Starting Node","totalsteps":"12"},"datacontenttype":"application/json","id":"bfb2efda-bf26-4e47-b745-1b0a3366e13e","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"6","message":"Creating docker container (CPUs=2, Memory=1990MB) ...","name":"Creating Container","totalsteps":"12"},"datacontenttype":"application/json","id":"b3017c52-e565-49d5-850a-f038bef8d3f5","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"8","message":"Preparing Kubernetes v1.19.4 on Docker 19.03.13 ...","name":"Preparing Kubernetes","totalsteps":"12"},"datacontenttype":"application/json","id":"108d626e-6a0a-4ce3-8521-f52d9cacd6af","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"10","message":"Verifying Kubernetes components...","name":"Verifying Kubernetes","totalsteps":"12"},"datacontenttype":"application/json","id":"63cded8a-fe6b-44d8-87b2-ba9aa1d82d4d","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"currentstep":"11","message":"Enabled addons: default-storageclass, storage-provisioner","name":"Enabling Addons","totalsteps":"12"},"datacontenttype":"application/json","id":"65a9f4d7-9866-417a-a7c4-d5e9cdecfdeb","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"} {"data":{"message":"/usr/local/bin/kubectl is version 1.16.6-beta.0, which may have incompatibilites with Kubernetes 1.19.4."},"datacontenttype":"application/json","id":"11e64450-c0d2-4884-b210-12dcd2bc3e50","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.warning"} {"data":{"message":"Want kubectl v1.19.4? Try 'minikube kubectl -- get pods -A'"},"datacontenttype":"application/json","id":"df0d59f2-983e-4392-8529-16343e895300","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.info"} {"data":{"currentstep":"12","message":"Done! kubectl is now configured to use \"minikube\" cluster and \"default\" namespace by default","name":"Done","totalsteps":"12"},"datacontenttype":"application/json","id":"4cc4a768-206b-48fd-8ccb-d355059508f3","source":"https://minikube.sigs.k8s.io/","specversion":"1.0","type":"io.k8s.sigs.minikube.step"}