tasks: Reset SELinux level of images on startup #560
Merged
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.
In some situations (in particular the fedora-rawhide-boot and -payload images) gain an extra SELinux "Multi-category range" context like this:
This makes them undeletable by
image-prune
,rm
, or anything else that the container could do. This causes old images to pile up, and the host eventually fails with ENOSPC.There is nothing that the container can do to fix these files, and it's not clear what causes this in the first place. To mitigate, reset the context level in the system unit at startup.
Our bots have ran into ENOSPC quite frequently, but so far I had always only quick-fixed this by mass-deleting the image cache. This should fix it more permanently.
I rolled this out to all our bots. I confirmed it fixed the broken contexts on cockpit-10, so by tomorrow, cockpit-10 should do an image-prune run and clean up its current 501 GB in /var/cache/cockpit-tasks/images/