Skip to content

fix(update-module): handle missing PREV_IMAGE_URL - #1340

Merged
DavidePrincipi merged 1 commit into
mainfrom
bug-8180
Oct 8, 2026
Merged

DavidePrincipi merged 1 commit into
mainfrom
bug-8180

Conversation

@DavidePrincipi

Copy link
Copy Markdown
Member

Updating a module that was never updated before, using the same image URL it already runs and without --force, makes the update-module task fail with KeyError: 'PREV_IMAGE_URL' in step 95cleanup_images. See NethServer/dev#8180.

The cleanup step now skips the old image removal when no previous image is recorded, like the cluster update-module action already does. Normal updates and --force updates behave as before.

How to test

  • Install a module from a floating tag, e.g. add-module ghcr.io/nethserver/dokuwiki:latest 1
  • Without updating it first, run update-module ghcr.io/nethserver/dokuwiki:latest dokuwiki1
  • The task completes successfully with the "already installed" warning
  • Update a module to a different version and check that the previous image is still removed

Generated by Claude Code:claude-opus-5-5 with nethserver-pr

The cleanup step crashed with KeyError when PREV_IMAGE_URL was not
set. This happens when a module that was never updated before is
updated to the image URL it already runs, without the force flag:
the pull step exits early and does not record the previous image.

Skip the old image removal when no previous image is recorded, as
the cluster update-module action already does.

Assisted-by: Claude Code:claude-opus-5-5
@DavidePrincipi DavidePrincipi self-assigned this Oct 6, 2026
@DavidePrincipi
DavidePrincipi requested a review from stephdl October 6, 2026 16:12
@DavidePrincipi
DavidePrincipi merged commit 6b2319d into main Oct 8, 2026
2 checks passed
@DavidePrincipi
DavidePrincipi deleted the bug-8180 branch October 8, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants