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

Update notice breaks JSON output #1825

Open
tmfksoft opened this issue Mar 13, 2024 · 1 comment
Open

Update notice breaks JSON output #1825

tmfksoft opened this issue Mar 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tmfksoft
Copy link

Bug description

When automating client management with Headscale using CLI and --output=json the JSON output is 'broken' by the message starting with "An updated version of Headscale has been found" etc, I can't take the JSON output directly.

Is there a flag to disable this output?

While actually updating obviously fixes this I can't sit checking every 5 minutes for an update.

Environment

I'm running Headscale v0.23.0-alpha2 under Ubuntu 22.0.4, though Headscale does need updating.

To Reproduce

Run the command
headscale users list --output=json

@tmfksoft tmfksoft added the bug Something isn't working label Mar 13, 2024
@fredrikekre
Copy link

headscale users list --output json works (note the missing =) so this is an inconsistency in argument parsing where the real argument parser handles it, but the crude check for machine output here

func HasMachineOutputFlag() bool {
for _, arg := range os.Args {
if arg == "json" || arg == "json-line" || arg == "yaml" {
return true
}
}
return false
}
doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants