-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disable Image Scanning with a flag [take 2] #2745
Conversation
1e47ab0
to
957132c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the newly added flag to the documentation? Probably with a highlight about the fact that this also disables the fluxctl
automation features.
@@ -196,6 +196,9 @@ func (s ReleaseImageSpec) calculateImageUpdates(rc ReleaseContext, candidates [] | |||
ref, err = s.ImageSpec.AsRef() | |||
if err == nil { | |||
singleRepo = ref.CanonicalName() | |||
// FIXME(fons): we probably want to allow this operation even if image | |||
// scanning is disabled. We could either avoid the validation | |||
// or use an uncached registry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uncached registry is not an option, Michael shared insights about this in the superseded PR (Flux had this in the beginning but it lead to timeouts).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code only validates that the images exists, I think we can use an uncached registry for that. Otherwise releasing a specific image won't work.
If read-only is enabled then I think it should also disable image scanning as for a read-only Flux it doesn't make sense to maintain a a cache of images or depend on memcached. Furthermore I would make the read-only flag in the fluxctl install command omit the memcached deployment from the manifests output. The same applies for the Helm chart, when |
@stefanprodan note that listing images doesn't work when disabling image scanning but it works in read-only. There may be other things on top of that that I haven't thought of. |
I changed |
269dd8b
to
3a77351
Compare
Co-Authored-By: Stefan Prodan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PTAL, I added |
Co-Authored-By: Stefan Prodan <[email protected]>
Those two things are related, but not coupled. You may very well want to query the image metadata while not wanting to write to the git repo.
What, turning registry scanning off forces it to treat the repo as writable? That doesn't make any sense. |
I meant
I was on the fence about this one, @stefanprodan convinced me about not making much sense to have the scanning just for |
We can still revert that, nothing was released yet. |
@@ -33,21 +33,23 @@ fluxctl install --git-url '[email protected]:<your username>/flux-get-started' | ku | |||
cmd.Flags().StringVar(&opts.GitBranch, "git-branch", "master", | |||
"Git branch to be used by Flux") | |||
cmd.Flags().StringSliceVar(&opts.GitPaths, "git-paths", []string{}, | |||
"Relative paths within the Git repo for Flux to locate Kubernetes manifests") | |||
"relative paths within the Git repo for Flux to locate Kubernetes manifests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come these all got lowercased, en passant .. looking at the other subcommands, the usage messages tend to start with capitals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, I did it after fluxd
's flags (wrongly assuming that the rest of the fluxctl
commands followed the as pattern)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to revert that, but I think fluxd
and fluxctl
should be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed it because it caused a merge conflict (easily solved, I just need to know which direction to solve it in ..)
Good point on being consistent with fluxd; I'll resolve the conflict with the least change, then do them all at once in another PR. (i.e., don't worry about reverting!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
When you mention We would have |
That's what the flag added in this PR does.
We were referring to `--git-readonly| |
Ok. Thanks. I guess I wasn't reading it that way. We would like the following:
But the comments seem to me to indicate if
` |
That's really interesting. There is discussion about that at #2790 Would you mind explaining there why would you need
|
Perhaps we do not understand the functions but here is what we are thinking. We want to use So perhaps we don't understand what the Based on the following, we thought that Flux needed to write back to the repo to keep track of what it had applied.
|
So, what you mean is that you what |
That is correct. From what I can tell in the doc, that is the purpose of the flag. I see that it would also control the updates for new images, but it seems you could have readonly=false and not apply new images.
|
Looking at #2790, I would think that |
Because there are API methods for querying workloads and the images they use, and those depend on having scanned registry entries, and have nothing to do with whether you can write to git or not. |
So in that case, the two parms are totally unrelated. |
@texasbobs note that (regardless of what the help messages say, they are wrong right now) as it is in |
Overrides #2524
I made sure that the memcached client is not initialized when scanning is disabled. Also, I added proper errors when querying the registry if scanning is disabled.