You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a Required attribute to PluginConfigOption, which would automatically ensure that the option was provided, so plugins developer don't have manually loop through options to make sure they were indeed provided.
The text was updated successfully, but these errors were encountered:
the cobra package makes it easy to mark a commandline flag as required, but its not clear how useful this is considering we allow stdin json attributes to override options,
"required" gets a bit complicated for plugins because we allow the stdin event json to provide overrides using the plugin keyspace + option.path construct. The input json has to be parsed before we know if the option is really set or not...and that is well past the point where cobra's built in logic for cmdline option processing can help.
This is why the derived classes goHandler, goMutator, goCheck all use a user defined validationFunction that gets called after the json from stdin is processed and the path overrides are evaluated.
I really can't think of a clean way to avoid the user defined validation because of the json parsing overrides using the keyspace and option.Path pattern. At best I can use the cobra MarkFlagRequired() function if the option Path is not set..so we are sure that the option does not have a json based override.
Add a
Required
attribute toPluginConfigOption
, which would automatically ensure that the option was provided, so plugins developer don't have manually loop through options to make sure they were indeed provided.The text was updated successfully, but these errors were encountered: