Add support for conditional image tarball imports#12237
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12237 +/- ##
===========================================
- Coverage 40.36% 19.82% -20.54%
===========================================
Files 187 184 -3
Lines 19211 19136 -75
===========================================
- Hits 7754 3794 -3960
- Misses 10273 14912 +4639
+ Partials 1184 430 -754
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
brandond
force-pushed
the
track-imported-files
branch
from
May 2, 2025 23:12
45ce4b4 to
d0feb20
Compare
Normally K3s will import all tarballs in the image dir on startup, and re-import any tarballs that change while it is running. This change allows users to opt into only importing tarballs that have changed since they were last imported, even across restarts. This behavior is opted into by touching a `.cache.json` file in the images dir. This file is used to track the size and mtime of the image files when they are imported. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond
force-pushed
the
track-imported-files
branch
from
May 5, 2025 19:11
d0feb20 to
2cb677e
Compare
matttrach
approved these changes
May 6, 2025
vitorsavian
approved these changes
May 7, 2025
This was referenced May 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Normally K3s will import all tarballs in the image dir on startup, and re-import any tarballs that are created or changed while it is running.
This change allows users to opt into only importing tarballs that have changed since they were last imported, even across restarts.
This behavior is opted into by touching a
.cache.jsonfile in the images dir. This file is used to track across restarts the size and mtime of the image files when they are imported.Types of Changes
enhancement
Verification
mkdir -p /var/lib/rancher/k3s/agent/images/; touch /var/lib/rancher/k3s/agent/images/.cache.jsonTesting
Existing tests cover airgap image import
Linked Issues
User-Facing Change
Further Comments