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

make it obvious in terminal for user if using docker-env #6489

Open
medyagh opened this issue Feb 4, 2020 · 19 comments
Open

make it obvious in terminal for user if using docker-env #6489

medyagh opened this issue Feb 4, 2020 · 19 comments
Assignees
Labels
co/docker-env docker-env issues good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@medyagh
Copy link
Member

medyagh commented Feb 4, 2020

I was thinking as part of the eval $(minikube docker-env) we could pass something that changes the terminal Prompt so it is obvious for the user they are usinf minikube's docker not their own docker.

maybe:
something like:

medya@~ $ PS1="$PS1""(using minikube dockerd) $:"

that will try turn into

medya@~ $ (using minikube dockerd) $:

the minikube word would be profile name, this will also make it clear which profile's docker-env we are using.

helps with #6462
helps with #6437

also we could explicity set a ENV that says

USES_MINIKUBE_DOCKERD=PROFILE_NAME
@medyagh medyagh changed the title make it obvious for user if using docker-env make it obvious in terminal for user if using docker-env Feb 4, 2020
@medyagh medyagh added the co/docker-env docker-env issues label Feb 4, 2020
@tstromberg
Copy link
Contributor

Environment variable sounds good.

I wouldn't be opposed to prompt manipulation if it was an extra flag to docker-env. Like minikube docker-env --prompt. I would prefer it be explicit, as not everyone is going to like us manipulating their prompt.

Keep in mind that many folks build prompts with dynamic functions, particularly in the zsh and fish community.

@tstromberg tstromberg added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Feb 5, 2020
@medyagh medyagh added this to the v1.9.0 March 30th milestone Mar 7, 2020
@medyagh medyagh self-assigned this Mar 7, 2020
@afbjorklund
Copy link
Collaborator

This sounds like something that should be a part of docker, rather than minikube ?
i.e. displaying the DOCKER_HOST in the prompt

We don't even put the current kubectl context in the prompt, which sounds more related.
Like in https://github.com/jonmosco/kube-ps1

@afbjorklund
Copy link
Collaborator

afbjorklund commented Mar 15, 2020

I guess this is now implemented, with MINIKUBE_ACTIVE_DOCKERD ?

What needs to be done is a shell function to use it, similar to:
https://gist.github.com/aburnett/1165239cd2673a43579c

Then the user can use that in their PS1, similar to e.g. __git_ps1
https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

One thing that is weird is that it shows the name of the profile (not host) ?

@tstromberg tstromberg removed this from the v1.9.0 March 24th milestone Mar 18, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 16, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 16, 2020
@priyawadhwa
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 29, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 27, 2020
@afbjorklund
Copy link
Collaborator

afbjorklund commented Oct 27, 2020

#6489 (comment)

I guess this is now implemented, with MINIKUBE_ACTIVE_DOCKERD ?

__active_minikube() {
    FORMAT=$1
    if [ -n "$MINIKUBE_ACTIVE_DOCKERD" ] ; then
      EMOJI=$(printf "\U1F433") # :whale:
      printf " $FORMAT" "$MINIKUBE_ACTIVE_DOCKERD" "$EMOJI"
    elif [ -n "$MINIKUBE_ACTIVE_PODMAN" ] ; then
      EMOJI=$(printf "\U1F381") # :gift:
      printf " $FORMAT" "$MINIKUBE_ACTIVE_PODMAN" "$EMOJI"
    fi
}

PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__active_minikube "%s %s")\$ '
user@host:~/minikube$ eval $(minikube docker-env)
user@host:~/minikube minikube 🐳$ eval $(minikube docker-env -u)
user@host:~/minikube$ eval $(minikube podman-env)
user@host:~/minikube minikube 🎁$ eval $(minikube podman-env -u)
user@host:~/minikube$

@afbjorklund
Copy link
Collaborator

afbjorklund commented Oct 27, 2020

weird shells left as an exercise for the reader... but looking at variables is "cheaper" than starting minikube

@priyawadhwa @medyagh @tstromberg - you still think that this feature is worth doing / documenting ?

@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 26, 2020
@medyagh
Copy link
Member Author

medyagh commented Dec 9, 2020

weird shells left as an exercise for the reader... but looking at variables is "cheaper" than starting minikube

@priyawadhwa @medyagh @tstromberg - you still think that this feature is worth doing / documenting ?

I believe we can change this from a feature to a tip on the tutorial on minikube website.

I would be happy to accept a PR that puts @afbjorklund 's suggestion to a nicely written tutorial.

@medyagh medyagh added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Dec 9, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 9, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 8, 2021
@sharifelgamal sharifelgamal removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Apr 28, 2021
@JacekDuszenko
Copy link
Contributor

I would be happy to accept a PR that puts @afbjorklund 's suggestion to a nicely written tutorial.

I'd happily add the tutorial.
@medyagh which place in the docs would be the best to put it in? Could you post a link? Thanks

@spowelljr
Copy link
Member

@JacekDuszenko We have a tutorial section on the minikube website here: https://minikube.sigs.k8s.io/docs/tutorials/

@JacekDuszenko
Copy link
Contributor

Cool, I'll add it there then /assign @JacekDuszenko

@JacekDuszenko
Copy link
Contributor

/assign @JacekDuszenko

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 21, 2021
@spowelljr
Copy link
Member

@JacekDuszenko Are you still working on this?

@spowelljr spowelljr added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-env docker-env issues good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

10 participants