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

odo telemetry prompt can interfere with bash commands #7145

Closed
amisevsk opened this issue Nov 9, 2023 · 3 comments
Closed

odo telemetry prompt can interfere with bash commands #7145

amisevsk opened this issue Nov 9, 2023 · 3 comments
Labels
area/telemetry Issues or PRs related to telemetry or metrics collection kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@amisevsk
Copy link

amisevsk commented Nov 9, 2023

/kind bug

What versions of software are you using?

Operating System: Linux

Output of odo version: odo v3.15.0 (10b5e8a8f)

How did you run odo exactly?

With the goal of getting the current odo version:

odo version --client | grep -Eo 'v?[0-9]+\.[0-9]+\.[0-9]+'

(on first run, before seeing telemetry prompt)

Actual behavior

The command hangs indefinitely and cannot be cancelled (i.e. ctrl+c does not work).

Expected behavior

Either odo should prompt for telemetry on stderr (instead of stdout) so that users see the prompt in these cases, or it should avoid prompting when output is redirected to a file/pipe.

Any logs, error output, etc?

Can be reproduced with the following Dockerfile

FROM registry.access.redhat.com/ubi8-minimal:8.8-860

RUN microdnf install -y curl \
    && curl -L https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/odo/v3.15.0/odo-linux-amd64 -o /usr/local/bin/odo \
    && chmod a+x /usr/local/bin/odo \
    && microdnf -y clean all

RUN echo -e '#!/bin/bash \n\
             odo version --client | grep -Eo "v?[0-9]+\.[0-9]+\.[0-9]+" \n\
             exec "$@"' > /entrypoint.sh \
    && chmod a+x /entrypoint.sh

ENTRYPOINT [ "/entrypoint.sh" ]

If I build an image from this Dockerfile, then

  • If I run podman run <image> it prints odo's version
  • If I run podman run -it --rm <image> /bin/bash, it hangs indefinitely and must be podman killed

More background

The Web Terminal Operator includes odo as part of its built-in tooling. In order to be able to list the software and versions installed, the web-terminal-tooling container generates a "installed-versions.txt" file at startup using the above command, which can hang if e.g. it is run from an interactive prompt.

As a workaround, we just close stdin before calling the script, which avoids the issue.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 9, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Nov 9, 2023
@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Nov 11, 2023
@rm3l
Copy link
Member

rm3l commented Nov 11, 2023

/area telemetry
/remove-status needs-triage

Hi @amisevsk,

Thanks for reporting this issue.

While I agree it makes sense for odo to avoid prompting when the output is piped or redirected to a file, I'd like to suggest two more things:

Would that work for you?

@openshift-ci openshift-ci bot added the area/telemetry Issues or PRs related to telemetry or metrics collection label Nov 11, 2023
Copy link
Contributor

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 10, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 30 days since being marked as stale.

@github-actions github-actions bot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 11, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
@github-project-automation github-project-automation bot moved this to Done ✅ in odo Project Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/telemetry Issues or PRs related to telemetry or metrics collection kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
Archived in project
Development

No branches or pull requests

2 participants