-
Notifications
You must be signed in to change notification settings - Fork 188
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
Garbage collect with provided retention options #638
Conversation
9d6da04
to
18c2f29
Compare
be78b48
to
d9cf6de
Compare
5e6e6c8
to
68ef63d
Compare
if err := testStorage.MkdirAll(*obj.Status.Artifact); err != nil { | ||
return err | ||
} | ||
if err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader(v), 0644); err != nil { |
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 err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader(v), 0644); err != nil { | |
if err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader(v), 0o644); err != nil { |
if err := testStorage.MkdirAll(*obj.Status.Artifact); err != nil { | ||
return err | ||
} | ||
if err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader("file"), 0644); err != nil { |
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 err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader("file"), 0644); err != nil { | |
if err := testStorage.AtomicWriteFile(obj.Status.Artifact, strings.NewReader("file"), 0o644); err != nil { |
d03d02b
to
d98e93c
Compare
9b97975
to
391d559
Compare
c46dd51
to
dc6b9e5
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.
This LGTM if the commits are smashed. Thank you @aryan9600 🥇
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.
🚀
dc6b9e5
to
641bc19
Compare
Introduce two new flags to configure the ttl of an artifact and the max no. of files to retain for an artifact. Modify the gc process to consider the options and use timeouts to prevent the controller from hanging. This helps in situations when the SC has already garbage collected the current artifact but the advertised artifact url is still the same, which leads to the server returning a 404. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
641bc19
to
f8c27a8
Compare
Adds two ways (a ttl for each artifact and max number of artifact per objects) to customize garbage collection. Adds a timeout context to cancel garbage collection after a duration.
Ref: #602
Signed-off-by: Sanskar Jaiswal jaiswalsanskar078@gmail.com