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
This is a proposal to switch to regular unix-style argument handling when enabling addons. Briefly, instead of this:
microk8s.enable kubeflow:"bundle=lite"
switch to this:
microk8s.enable kubeflow --bundle lite
The big issue to solve is that right now, users can enable multiple addons at once like this:
microk8s.enable gpu kubeflow
So, we run into an issue of how to handle argument parsing with multiple addons at once. The easiest thing to do would be to just disallow enabling multiple addons at once when using unix-style argument handling. The only issue with this is that an addon may want positional arguments. For example, say the kubeflow addon allowed a positional argument of which bundle size to deploy, like this:
microk8s.enable kubeflow lite
If the user types microk8s.enable kubeflow gpu dns, do we parse that as the user wanting 3 addons enabled, or only kubeflow and dns enabled, and they mistakenly typed gpu instead of full?
However, if we stick to only parameter flags such as --foo bar, it should be possible to implement unix-style argument handling in a backwards-compatible way. In pseudocode, we could have logic like this:
ifall(a.split(':')[0] inADDONSforainARGS):
# We have a command line made entirely of addon names, with or without params# e.g. `microk8s.enable foo bar:"123" baz`foraddoninARGS:
enable(addon)
else:
# Treat as unix-style arguments, where enabling multiple addons at once is disallowed# Positional arguments are also disallowed
...
As a further proposal, I think we should move to click, which will make it easy to create a cohesive CLI experience, as it automatically handles stuff such as argument parsing and --help flags.
The text was updated successfully, but these errors were encountered:
This is a proposal to switch to regular unix-style argument handling when enabling addons. Briefly, instead of this:
switch to this:
The big issue to solve is that right now, users can enable multiple addons at once like this:
So, we run into an issue of how to handle argument parsing with multiple addons at once. The easiest thing to do would be to just disallow enabling multiple addons at once when using unix-style argument handling. The only issue with this is that an addon may want positional arguments. For example, say the
kubeflow
addon allowed a positional argument of which bundle size to deploy, like this:If the user types
microk8s.enable kubeflow gpu dns
, do we parse that as the user wanting 3 addons enabled, or onlykubeflow
anddns
enabled, and they mistakenly typedgpu
instead offull
?However, if we stick to only parameter flags such as
--foo bar
, it should be possible to implement unix-style argument handling in a backwards-compatible way. In pseudocode, we could have logic like this:As a further proposal, I think we should move to click, which will make it easy to create a cohesive CLI experience, as it automatically handles stuff such as argument parsing and
--help
flags.The text was updated successfully, but these errors were encountered: