-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reformulate --registry-scanning
#2790
Comments
No strong opinions on (1) About (2), I am actually with you but @stefanprodan pushed for that arguing user expectations (and he may be right), so I will let you two sort that one out :) |
It's the other way around, |
Ok so we need to reformulate that to |
I'm not sure I agree with the "usage implication" running the other way, either: it is possible you might want to be able to query for the image metadata, but not run automation. From the point of view of "what's the easiest way to access the common modes of use", roughly we have these modes of use:
Having |
True, the code does the right thing though |
Yes, there is the different but also serious problem of the argument not behaving as the usage message say it does :-/ |
Of course, I will fix it in one way or another based on what's decided here. |
@stefanprodan Do you buy the argument in terms of modes of use, made above? |
People that I've talked to on Slack and elsewhere wanted the readonly mode to allow them to run Flux stand-alone without memcached. I don't see why would someone enable readonly mode and have a need for Flux to scan the registries. While your point is valid, I've never seen a user asking for readonly without asking how to disable registry scanning also. As for Weave Cloud, I don't think we allow users to switch to readonly. Having said that, I'm not going to insist on this, if you think it's best to use two flags, we can undo the change and document how to make Flux truly readonly with |
No strong opinions on my side. @squaremo make a call and I will make adjustments one way or another :) |
Based on messages I have received from the community I have to side with @stefanprodan, but I'll leave it up to you two to make the final call. |
I think we have a compelling usecase to keep So, now I am with @squaremo . |
I would keep the name of the flag as is though. |
Actually, how it is now |
Anyways. I think I will keep the flags independent for now. |
The flag
--registry-scanning
is well-motivated, but can be refined further.--disable-registry-scanning
(or--registry-disable-scanning
)In general, boolean flags that default to
true
should be used sparingly if at all. Such a flag has to be given a value to have an effect, which breaks the expectation that a boolean flag is provided without a value. (And there are other problems with default-true boolean values; for example, if you have a go struct defining the config, the field value will default to false rather than true, so you have to be extra careful about how you populate it).You can argue that it's awkward to have a
--disable-X
flag -- yes it is. Designing from scratch, you would have--enable-registry-scanning
to switch that particular optional thing on. But the starting point is that fluxd already does a bunch of things, so you have to go the other way around, and switch things off -- and the less surprising way to do it is to use flags which default to false.--registry-scanning=false
should imply--git-readonly
.It doesn't logically imply it -- it's totally possible to use a writable git repo while switching registry scanning off.
But there's no particular motivation for making git read-only when you're not scanning image registries, either. Automation of image updates isn't possible if you are not looking at image metadata, but that doesn't mean you don't want to write to the git repo -- you may still use a tag as the high-water mark, and you may still want to be able to e.g., change automation policies.
A better factoring would be to have
--registry-scanning=false
imply disabling automation, whether or not that's controlled by a switch itself.The text was updated successfully, but these errors were encountered: