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

Centralize the handling of browser.OpenURL #7174

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

afbjorklund
Copy link
Collaborator

So we can catch when xdg-open not installed

Might help with #7168

So we can catch when xdg-open not installed
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 23, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

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 23, 2020
@afbjorklund afbjorklund requested a review from medyagh March 23, 2020 20:51
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.

PR looks good just one request, please handle the error gracefully in the caller, instead of crashing, ask user to install the right package
we dont want to direct user to create an issue if we dont want that issue to be created.

💣  open url failed: http://10.128.0.21:31284: exec: "xdg-open": executable file not found in $PATH
😿  minikube is exiting due to an error. If the above message is not useful, open an issue:

@afbjorklund
Copy link
Collaborator Author

Right, have to come up with a nice way of handling this.
Maybe just a text saying "please open a browser at ..."

Let the terminal user open it themselves
@afbjorklund afbjorklund changed the title WIP: Centralize the handling of browser.OpenURL Centralize the handling of browser.OpenURL Mar 23, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 23, 2020
@afbjorklund
Copy link
Collaborator Author

Went with emoji instead

@codecov-io
Copy link

Codecov Report

Merging #7174 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7174   +/-   ##
=======================================
  Coverage   37.08%   37.08%           
=======================================
  Files         145      145           
  Lines        9234     9234           
=======================================
  Hits         3424     3424           
  Misses       5387     5387           
  Partials      423      423           
Impacted Files Coverage Δ
cmd/minikube/cmd/config/open.go 11.86% <ø> (ø)
cmd/minikube/cmd/dashboard.go 1.63% <ø> (ø)
cmd/minikube/cmd/service.go 8.86% <ø> (ø)

_, err := exec.LookPath("xdg-open")
if err != nil {
out.T(out.URL, url)
return nil
Copy link
Member

Choose a reason for hiding this comment

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

how about some additional wording to the URL ?
how does this look like in the output ?

@medyagh
Copy link
Member

medyagh commented Mar 23, 2020

Went with emoji instead

do u mind pasting the ouput in the PR description so we see how it looks like?

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 23, 2020

I don't have the environment set up to reproduce it, but I guess it would look something like:

🎉  Opening service default/hello-minikube in default browser...
👉  http://10.128.0.21:31284

Hopefully the terminal emulator will make the link clickable for the user, if they connect remotely

@medyagh medyagh merged commit 93021fb into kubernetes:master Mar 24, 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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants