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

clusterctl describe not working in Windows PowerShell #7381

Closed
killianmuldoon opened this issue Oct 10, 2022 · 9 comments
Closed

clusterctl describe not working in Windows PowerShell #7381

killianmuldoon opened this issue Oct 10, 2022 · 9 comments
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@killianmuldoon
Copy link
Contributor

killianmuldoon commented Oct 10, 2022

Running cluster describe cluster my-cluster on PowerShell results in broken output as the colors are not rendered correctly. There is a current workaround involving setting a NO_COLOR environmental variable to print the output without color.

clusterctl describe (on main) supports a --color flag which forces color output when it's off by default (the library clusterctl uses fatih/color does this when the output is not to a terminal. Currently this flag defaults to false and is a no-op when set to false.

One solution to the PowerShell problem would be to change the usage of that flag so that when it's set to false it always turns the color off. That would allow users to explicitly opt out of using colors in the output.

/area clusterctl
/kind bug

@k8s-ci-robot k8s-ci-robot added area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 10, 2022
@fabriziopandini
Copy link
Member

/triage accepted

Q: should we report the issue to fatih/color maintainers? (or might be this already has been fixed in latest version of this library)

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 11, 2022
@sbueringer
Copy link
Member

I'm not sure if the library is wrong, but rather our usage of it.

@fabriziopandini
Copy link
Member

that could be another issue as well, but I think we should nail down the problem before deciding to workaround it

@killianmuldoon
Copy link
Contributor Author

killianmuldoon commented Oct 11, 2022

We're using the latest version (v1.13.0) but it's 1+ years old. This issue might have been solved in a more recent commit. I think changing the behaviour of the color flag is good as a change in any case, but it would be very nice if we could get color output working on PowerShell.

@sbueringer
Copy link
Member

sbueringer commented Oct 11, 2022

I think it's definitely bad that we still produce colored output if someone sets --color=false (if I understood it correctly)

I'm not sure if the library is wrong, but rather our usage of it.

Sorry, that was easily misunderstood. I was only referring to the way colored output can be enabled/disabled with our flag + how the lib reacts to NO_COLOR.

But of course let's also take a look at how the colored output is not rendered correctly in PowerShell and if a new library version fixes that or we should open an issue in their repo.

@killianmuldoon
Copy link
Contributor Author

I'll report the issue, bit after going over a bunch of workarounds it seems that there's a general issue with getting colors to work in PowerShell / cmd environments.

Changing the terminal settings as described here - https://stackoverflow.com/questions/51680709/colored-text-output-in-powershell-console-using-ansi-vt100-codes - worked to fix the output but did not actually get colors in the output 😕.

@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

@killianmuldoon
Copy link
Contributor Author

/close

I believe this was fixed in https://github.com/fatih/color/releases/tag/v1.15.0.

Closing due to lack of interest.

@k8s-ci-robot
Copy link
Contributor

@killianmuldoon: Closing this issue.

In response to this:

/close

I believe this was fixed in https://github.com/fatih/color/releases/tag/v1.15.0.

Closing due to lack of interest.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clusterctl Issues or PRs related to clusterctl kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants