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

gitops-pusher: invalid subcommand has unfriendly error #11842

Open
mhuxtable opened this issue Apr 23, 2024 · 0 comments · May be fixed by #11843
Open

gitops-pusher: invalid subcommand has unfriendly error #11842

mhuxtable opened this issue Apr 23, 2024 · 0 comments · May be fixed by #11843

Comments

@mhuxtable
Copy link

What is the issue?

I mistakenly passed the wrong action flag to the tailscale/github-cli-action action (sync, rather than the expected apply) and I received an unfriendly/non-obvious error from the CI pipeline:

terminal command () doesn't define an Exec function

In a CI context, it was not obvious where this error originated.

Steps to reproduce

go run ./cmd/gitops-pusher sync

(or pass any other invalid subcommand)

Are there any recent changes that introduced the issue?

No response

OS

No response

OS version

No response

Tailscale version

No response

Other software

No response

Bug report

No response

mhuxtable added a commit to mhuxtable/tailscale that referenced this issue Apr 23, 2024
If an invalid subcommand was provided to the gitops-pusher (e.g. I
mistakenly passed 'sync' rather than the expected 'apply'), the error
rendered from ffcli does not make this obvious to the operator,
particularly when rendered in a CI pipeline. The error was:

terminal command () doesn't define an Exec function

This trivial change catches the ffcli error and provides a friendlier
error to the user to hopefully aid their diagnosis of the problem in
these cases.

Fixes tailscale#11842.

Signed-off-by: Matthew Huxtable <git@tigermatt.uk>
mhuxtable added a commit to mhuxtable/tailscale that referenced this issue Apr 23, 2024
If an invalid subcommand was provided to the gitops-pusher (e.g. I
mistakenly passed 'sync' rather than the expected 'apply'), the error
rendered from ffcli does not make this obvious to the operator,
particularly when rendered in a CI pipeline. The error was:

terminal command () doesn't define an Exec function

This trivial change catches the ffcli error and provides a friendlier
error to the user to hopefully aid their diagnosis of the problem in
these cases.

Fixes tailscale#11842.

Signed-off-by: Matthew Huxtable <git@tigermatt.uk>
mhuxtable added a commit to mhuxtable/tailscale that referenced this issue Apr 23, 2024
If an invalid subcommand was provided to the gitops-pusher (e.g. I
mistakenly passed 'sync' rather than the expected 'apply'), the error
rendered from ffcli does not make this obvious to the operator,
particularly when rendered in a CI pipeline. The error was:

terminal command () doesn't define an Exec function

This trivial change catches the ffcli error and provides a friendlier
error to the user to hopefully aid their diagnosis of the problem in
these cases.

Fixes tailscale#11842.

Signed-off-by: Matthew Huxtable <git@tigermatt.uk>
mhuxtable added a commit to mhuxtable/tailscale that referenced this issue Apr 23, 2024
Aid diagnosis of invalid subcommands passed to the gitops-pusher,
particularly in the context of CI where the cause of the error is
non-obvious; an invalid subcommand previously rendered the following
error:

terminal command () doesn't define an Exec function

Fixes tailscale#11842.

Signed-off-by: Matthew Huxtable <git@tigermatt.uk>
mhuxtable added a commit to mhuxtable/tailscale that referenced this issue Apr 23, 2024
Aid diagnosis of invalid subcommands passed to the gitops-pusher,
particularly in the context of CI where the cause of the error is
non-obvious; an invalid subcommand previously rendered the following
error:

terminal command () doesn't define an Exec function

Fixes tailscale#11842.

Signed-off-by: Matthew Huxtable <git@tigermatt.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant