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

Improve bool definitions and execution behavior #487

Open
displague opened this issue Aug 28, 2024 · 1 comment
Open

Improve bool definitions and execution behavior #487

displague opened this issue Aug 28, 2024 · 1 comment

Comments

@displague
Copy link
Member

displague commented Aug 28, 2024

In #485, @stevemar, @ctreatma, and I discussed that while the precedent in metal-cli is for bool's to have --name=<true|false>, there is at least one exception with --app vs --sms for TFA.

We also discussed that in places where --name=false is used, we may not be handling it properly, where false values must be explicitly sent in API calls. These parameters are confusing to specify, and with Cobra, it is easy to miss incorrect handling during code review.

Metal CLI should adopt more obvious patterns for bools, such as named pairs (lock, unlock) or --no- prefixes.

It would be great to get these improvements from upstream project(s), but it can be implemented locally:

Originally posted by @displague in #485 (comment)

@waltribeiro
Copy link
Contributor

waltribeiro commented Aug 28, 2024

Is boolean the decided direction? I wouldn't be against a string like @ctreatma mentioned. I assume something like -x lock and -x unlock which feels intuitive.

Last month, Talos Linux spent almost an hour trying to figure out the iPXE boolean on Equinix Metal (here @ 51:52). However, it mustn't have been deployed as true during deployment, so they had to switch it inside the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants