-
Notifications
You must be signed in to change notification settings - Fork 217
Introduce artifact max size limit of 50MiB #929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0979fcc to
13b0783
Compare
13b0783 to
c68d2dd
Compare
| if s.ArtifactMaxSize > 0 && sz.written > s.ArtifactMaxSize { | ||
| return fmt.Errorf("artifact size %d exceeds the max limit of %d bytes", sz.written, s.ArtifactMaxSize) | ||
| } | ||
|
|
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.
Is the writerCounter incremented mid-flight as a stream? If so, within Walk we could short-circuit this process and stop other operations once the pre-set limit is reached.
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.
Yes but my intention here was to tell users which is the final size of the artifact.
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 would short circuit the process instead, as otherwise half of the usefulness of the bound is lost.
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.
If I move the check inside Walk then sz.written is always zero.
c68d2dd to
0dc411f
Compare
dd1e55b to
af969cf
Compare
Add a controller flag named "--artifact-max-size=<bytes>" with the default value of 50MiB. To disable the limit, the value can be set to "--artifact-max-size=-1". The flag enforces a max size limit for the artifact contents produced by source-controller, to avoid out-of-memory crashes of consumers such as kustomize-controller. Signed-off-by: Stefan Prodan <[email protected]>
af969cf to
3168bb6
Compare
Add a controller flag named
--artifact-max-size=<bytes>with the default value of 50MiB. To disable the limit, the value can be set to--artifact-max-size=-1.The flag enforces a max size limit for the artifact contents produced by source-controller, to avoid out-of-memory crashes of consumers such as kustomize-controller.
Closes: #901