Skip to content
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

Updates csi garbage-collector logic to work with images #748

Merged
merged 2 commits into from
May 5, 2022

Conversation

0sewa0
Copy link
Contributor

@0sewa0 0sewa0 commented Apr 27, 2022

Description

The image cache needs to be cleaned up otherwise the we can flood the node's filesystem with many 200MB+ image dirs.

This deletes any cached image that haven't been pulled for 2 weeks.
Every pull for an image changes its index.json even if the image was already cached, so its a good indicator of usage.

How can this be tested?

Well this is kinda hard, as for the "thing" to happen you need to wait for 2 weeks.
What you can do is change the time locally to 10 mins or something,
build the operator and use it, then create a dynakube that has codeModulesImage set.

Checklist

  • Unit tests have been updated/added
  • PR is labeled accordingly

@0sewa0 0sewa0 added the core Changes to core functionality of the Operator label Apr 27, 2022
@0sewa0 0sewa0 requested a review from a team as a code owner April 27, 2022 11:30
@0sewa0 0sewa0 changed the title Adds gc logic to clean old cached image Adds gc logic to images Apr 28, 2022
src/controllers/csi/gc/controller.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/controller.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images.go Show resolved Hide resolved
src/controllers/csi/gc/images.go Show resolved Hide resolved
src/controllers/csi/gc/images.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images_test.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images.go Show resolved Hide resolved
Base automatically changed from feature/copy-from-image to master April 29, 2022 11:02
@0sewa0 0sewa0 changed the title Adds gc logic to images Updates csi garbage-collector logic to work with images Apr 29, 2022
@0sewa0 0sewa0 requested review from meik99 and mjgrzybek April 29, 2022 12:37
src/api/v1beta1/properties.go Show resolved Hide resolved
src/controllers/csi/gc/controller.go Outdated Show resolved Hide resolved
src/controllers/csi/gc/images.go Show resolved Hide resolved
src/controllers/csi/gc/binaries.go Outdated Show resolved Hide resolved
@0sewa0 0sewa0 force-pushed the feature/clean-image-cache branch from 8aca779 to 924ef4e Compare May 4, 2022 12:19
@0sewa0 0sewa0 requested a review from meik99 May 4, 2022 12:33
@0sewa0 0sewa0 enabled auto-merge (squash) May 5, 2022 06:25
@0sewa0 0sewa0 merged commit 2b0739d into master May 5, 2022
@0sewa0 0sewa0 deleted the feature/clean-image-cache branch May 5, 2022 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core functionality of the Operator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants