-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support specifiying different image and additional args to fluxctl install
#2558
Conversation
a4735ad
to
1b64071
Compare
1b64071
to
bdcd63a
Compare
During the development of the initial `fluxctl install` command we decided against hooking the `AdditionalFluxArgs` up to the command. Time has however made it clear that: 1. There is a fair amount of people who would like to supply more arguments than we currently offer, and the manual edit currently required is quite cumbersome. 2. In the end-to-end tests that we are heavily expanding at the moment we use `fluxctl install` to bootstrap the Flux daemon in various configurations. Non-supported arguments are hacked in with `sed`, which is both very hard to read and quite tricky to maintain. This commit simply adds support for supplying additional arguments using a `--extra-flux-arguments` flag, which accepts a string array of `--arg=value`s. For improved UX the alphebetical sorting of flags has been disabled so that `--extra-flux-arguments` is listed at the bottom in the `fluxctl install --help` output.
This will help both users who maintain their own mirror of Flux images in a private registries as reported on Slack, as ourselves in end-to-end tests to target our image built in CI. Supplying the image is as simple as: `fluxctl install --flux-image fluxcd/flux:target [...]`
bdcd63a
to
7e4f65c
Compare
One reason I'm against having a flag for supplying anything you like is that it makes validation difficult. So for example, we insist on people providing a git user (at least an email), because it's something we don't want to leave to default; in #2544 I have to go to some lengths to verify that a value has been supplied as an argument or in the supplied config file. Adding arbitrary arguments would make that more complicated still. (But probably still possible?) Another reason is that it enables a poor user experience. If you can direct people to just supply extra arguments, you have an excuse for not thinking about your UI. A bit like introducing a "misc" category tends to destroy any filing scheme. |
None of the additional arguments are mandatory, validation would thus only go as far as 'do not supply things twice'. I would even argue that joining the arrays while preferring the values from the command line if duplicates exist may be better, as this is a common practice for functionalities like this to provide customizations on top of a predefined config (from file).
The experience as is can also be considered as 'poor UX', as any configuration that uses a combination of flag-enabled features can not be setup using this utility, and the alternative offered isn't scriptable in a reliable way. I think as long as the goal of the |
Not quite -- if the mandatory value is missing in the named args and missing in the config file, it would have to check that it had not been passed in the extra args. But the point is really more general than that: it's that once you build in an escape mechanism, you lose some ability to interpret what's being attempted by the user, and that means you are less effective at guiding them.
It depends what you consider to be the purpose of |
I understand @squaremo 's concerns, but I still find the extra parameters useful (and in fact AFAICR, the helm chart also supports extra arguments). An alternative (also solving @squaremo 's concerns, I think) could be exporting all the flags from |
+1 for exporting all fluxd flags in |
Some flags require other modifications to the manifest, which cannot be effected with |
@squaremo would you be more comfortable if we add flags on demand (as people request them or we need them internally)? I. am thinking that may be a non-ending task but can't think about anything else right now |
I would be comfortable if we considered each such request and made additions only when
I think it's a never-ending task to make |
I think a good compromise would be to add the most important flags that Flux supports, and document that for more versatile or advanced installs, the Helm chart or a custom deployment would be advisable. I found myself implementing a flag we need in our deployment in #2530 and did not find it too complicated. I didn't want to pollute the args that the install command accepts implementing the rest, but it is true that validation and understanding what the user is trying to achieve will help catching invalid settings and giving a poor UX in the end. |
@hiddeco Should we close this? |
Yep, I think I found the appropriate workaround by using |
As discussed in #2552, this adds support to
fluxctl install
for configuring a different image using--flux-image
and for supplying extra arguments using--extra-flux-arguments
.Both flags have been implemented in the e2e tests to get rid of the
sed
replace logic.This PR has potential of superseding #2530.