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

NOMAD_CLI_NO_COLOR env flag not working #10982

Closed
apollo13 opened this issue Aug 1, 2021 · 2 comments · Fixed by #11168
Closed

NOMAD_CLI_NO_COLOR env flag not working #10982

apollo13 opened this issue Aug 1, 2021 · 2 comments · Fixed by #11168
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug

Comments

@apollo13
Copy link
Contributor

apollo13 commented Aug 1, 2021

Nomad version

Nomad v1.1.3 (8c0c814)

Operating system and Environment details

Not relevant.

Issue

While working on #10975 I noticed that NOMAD_CLI_NO_COLOR does not work at all. Supplying -no-color works. main.go takes NOMAD_CLI_NO_COLOR into account

nomad/main.go

Lines 99 to 101 in 6d00c68

if os.Getenv(command.EnvNomadCLINoColor) != "" {
color = false
}
to configure the default UI colors. But nomad plan uses

nomad/command/meta.go

Lines 156 to 162 in 6d00c68

func (m *Meta) Colorize() *colorstring.Colorize {
return &colorstring.Colorize{
Colors: colorstring.DefaultColors,
Disable: m.noColor || !terminal.IsTerminal(int(os.Stdout.Fd())),
Reset: true,
}
}
which only cares about flags and not env vars. I am not sure what the best way of fixing is. Ie should the env vars override the flags or should they explicitly checked every time etc?

@jrasell jrasell added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli labels Aug 3, 2021
@jrasell jrasell added this to Needs Triage in Nomad - Community Issues Triage via automation Aug 3, 2021
@jrasell jrasell moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Aug 3, 2021
@jrasell
Copy link
Member

jrasell commented Aug 3, 2021

Thanks for spotting this @apollo13 and taking the time to fill this issue with such detail!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants