-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
required parameters don't work with altsrc #849
Comments
Yeah I discovered after my required flags PR that "altsrc" is a completely different code path, so you'd essentially have to implement every feature twice. Once in main, and once in altsrc 😩 I'm, having some negatives feelings about the architecture of altsrc :/ I'm gonna investigate moving some code from altsrc to the main package, which would fix this. |
I'm making this as a bug since externally it's a bug. The PR to fix this is probably gonna look like a new feature implementation PR though |
that sounds great! I was wondering myself why using |
After thinking on this a bunch more, I've come to the conclusion that I'm definitely going to fix this by adding all of the altsrc features into the main package, and removing altsrc entirely. My current idea is that that'll happen in v3, I'm tracking that here #833. So I'm gonna close this, since I'm closing all of the "altsrc doesn't work like the main package" issues. Apologies if this is rude, but I'm trying to burn down github issues. (I want to make sure I'm reading all of them! which means I've gotta close a bunch) |
waiting for v3 sucks, but getting a proper solution in the end sucks a bit less 😉 |
cert-file is used to derive certain required identifiers within the MQTT and HTTP clients. This effectively makes the cert-file a required field, but we have to manually check for their non-empty values because of limitations in the cli package. See urfave/cli#849. Fixes RHCLOUD-12333 Signed-off-by: Link Dupont <link@sub-pop.net>
We can't use the Required: true API from "github.com/urfave/cli/v2" since that will complain even if the flag is set in a config file. urfave/cli#849 In future we may want to force these keys to be supplied at the command line (best practices would steer away from storing sensitive information in a config file). This commit also enhances the output of the constructor.
Hi,
Unless I'm somehow overlooking something obvious, it seems the new
Required
support introduced in #819 doesn't work withaltsrc
.The following code (based on the example for
altsrc
) complains thatsomeflag
wasn't supported ifRequired: true
, but works if you comment that line out.And the accompanying YAML file (
test_cli_yaml.yaml
):@lynncyrin, I suspect your question in #825 might be related to this, right?
The text was updated successfully, but these errors were encountered: