Skip to content

Remember a kept cached image until the upstream changes - #119

Merged
MickLesk merged 1 commit into
mainfrom
fix/vm-cache-keep
Oct 8, 2026
Merged

MickLesk merged 1 commit into
mainfrom
fix/vm-cache-keep

Conversation

@MickLesk

@MickLesk MickLesk commented Oct 8, 2026

Copy link
Copy Markdown
Member

"Keep cached" in vm_fetch_image was asked on every run once a mirror had rebuilt an image (Debian's latest cloud images do that regularly). The answer is now stored next to the file in <file>.keep together with the upstream checksum it was given against; the question returns only when that checksum changes, and a download removes the marker. Without a published checksum nothing changes.

Covered by a new case in tests/vm-helpers.sh (41 pass).

Keep cached was asked on every run once the mirror had rebuilt an image. The answer is now stored in <file>.keep with the upstream checksum, and the question returns only when that checksum changes; a download removes the marker.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Try this branch

The engine and the scripts resolve independently, so a production script can
be run against the engine from this PR by setting one variable:

COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/fix/vm-cache-keep \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"

Swap ct/debian.sh for whatever exercises the change.

This PR touches pve/, so it needs a Proxmox VE host.

Run a script from a fork as well
curl -fsSL https://raw.githubusercontent.com/community-scripts/core/fix/vm-cache-keep/tools/run.sh |
  bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
             https://raw.githubusercontent.com/community-scripts/core/fix/vm-cache-keep

Note that run.sh is reached through a pipe, so the script it starts inherits
an exhausted stdin. Whiptail is fine — it opens /dev/tty — but a plain read
would see EOF. The single-variable form above does not have that problem.

Useful flags while testing

dev_mode=net logs every engine fetch with status and duration, which is the
quickest way to confirm the branch is really being used. dev_mode=keep stops a
failed build from deleting the container along with the evidence.

@MickLesk
MickLesk merged commit e59cb33 into main Oct 8, 2026
4 checks passed
@github-actions
github-actions Bot deleted the fix/vm-cache-keep branch October 8, 2026 08:39
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.

1 participant