Repository navigation
fix(update-module): skip missing previous images - #1358
Merged
Merged
Conversation
When an update adds an image the module did not have, there is no previous image, but the environment stored PREV_<NAME>_IMAGE=None and the cleanup step ran "podman image rm None", logging an error. Store PREV_<NAME>_IMAGE only when a previous image exists, and remove a stale one otherwise. The cleanup step also skips empty and "None" values, which earlier releases left in module environments. Assisted-by: Claude Code:claude-opus-5.5
stephdl
approved these changes
Oct 15, 2026
Member
Author
|
Tested on a single-node cluster with core
The unrelated All metrics services were running after each update. Assisted-by: Claude Code:claude-opus-5-5 |
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.
When a module update adds an image the module did not have before,
update-modulestoresPREV_<NAME>_IMAGE=Nonein the module environment, and the cleanup step then runspodman image rm None. The update succeeds, but the log shows a failed removal and the bogus variable stays in the environment. It was found while testing ns8-metrics 1.6.0-dev.1, which adds themetrics-grafanaimage. NethServer/dev#8210Updates now record a previous image only when one exists, and remove a stale previous value otherwise. The cleanup step also skips empty and
Nonevalues, so environments already holdingNonefrom earlier releases are handled. Updates that replace an image behave as before.update-module/05pullimages: setPREV_<NAME>_IMAGEonly if<NAME>_IMAGEwas already set, otherwise unset itupdate-module/95cleanup_images: skip previous images that are empty orNone; complements fix(update-module): handle missing PREV_IMAGE_URL #1340, which did the same forPREV_IMAGE_URLHow to test
metrics1.5.1 to 1.6.0-dev.1), runupdate-moduleand check that noPREV_<NAME>_IMAGE=Noneis written and the log has nopodman image rm NonePREV_<NAME>_IMAGE=None, run an update and check that the value is removed without errorsThese cases were checked on a test node (core 3.23.0 with the two patched steps copied in), including a direct run of
95cleanup_imageswithNone, empty and real previous images.See also
Generated by Claude Code:claude-opus-5.5 with nethserver-pr