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

docker-env & podman-env: silent output when talking to a shell #10763

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Mar 9, 2021

If the output is not a terminal, then assume that we are running
docker-env or podman-env under "eval" or similar shell construct.

So don't output all the interactive information, but only return
the actual exit code for some further troubleshooting (perhaps).

Closes #10761


BEFORE

$ eval $(minikube docker-env)
🤷: command not found
$ minikube docker-env
🤷  The control plane node must be running for this command
👉  To start a cluster, run: "minikube start"

or, even worse:

$ export MINIKUBE_IN_STYLE=false
$ eval $(minikube docker-env)
CHANGELOG.md: command not found
$ minikube docker-env
* The control plane node must be running for this command
  - To start a cluster, run: "minikube start"

AFTER

$ eval $(minikube docker-env)
$
$ minikube docker-env
🤷  The control plane node must be running for this command
👉  To start a cluster, run: "minikube start"

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 9, 2021
@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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 9, 2021
If the output is not a terminal, then assume that we are running
docker-env or podman-env under "eval" or similar shell construct.

So don't output all the interactive information, but only return
the actual exit code for some further troubleshooting (perhaps).
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.

@afbjorklund could u plz post the before and after this PR in description ?

I think this worth an integration test, how about adding one in the DockerEnv Test?

@afbjorklund
Copy link
Collaborator Author

@afbjorklund could u plz post the before and after this PR in description ?

Already done, see #10761 (comment)

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.

I think adding an integraiton test will ensure we will never break this

how about adding one here in validateDockerEnv
https://github.com/medyagh/minikube/blob/8da592988da45acfc93cef2637e79a8bfa4ad570/test/integration/functional_test.go#L216

pkg/minikube/out/out.go Show resolved Hide resolved
@medyagh
Copy link
Member

medyagh commented Mar 10, 2021

/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 10, 2021
@minikube-pr-bot
Copy link

kvm2 Driver
error collecting results for kvm2 driver: timing run 0 with Minikube (PR 10763): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10763/minikube start --driver=kvm2]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10763/minikube: exec format error
docker Driver
error collecting results for docker driver: timing run 0 with Minikube (PR 10763): timing cmd: [/home/performance-monitor/.minikube/minikube-binaries/10763/minikube start --driver=docker]: starting cmd: fork/exec /home/performance-monitor/.minikube/minikube-binaries/10763/minikube: exec format error

@medyagh medyagh merged commit df7cb64 into kubernetes:master Mar 10, 2021
@medyagh medyagh changed the title Silent output when talking to a shell docker-env and podman-env: silent output when talking to a shell Mar 10, 2021
@medyagh medyagh changed the title docker-env and podman-env: silent output when talking to a shell docker-env &podman-env: silent output when talking to a shell Mar 10, 2021
@medyagh medyagh changed the title docker-env &podman-env: silent output when talking to a shell docker-env & podman-env: silent output when talking to a shell Mar 10, 2021
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. pr_verified 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.

error output of "minikube docker-env" should go to stderr
4 participants