Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxd/image: set Cached: false for pre-existing cached image #13296

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Apr 10, 2024

closes #13271

@gabrielmougard gabrielmougard force-pushed the fix/set-cached-false-pre-existing-image branch 3 times, most recently from 3330c36 to 5184468 Compare April 10, 2024 09:39
@tomponline
Copy link
Member

test failures

@gabrielmougard gabrielmougard force-pushed the fix/set-cached-false-pre-existing-image branch from 5184468 to 7c9eb3d Compare April 10, 2024 10:38
@gabrielmougard
Copy link
Contributor Author

@tomponline tests are passing now

lxd/db/images.go Outdated Show resolved Hide resolved
lxd/daemon_images.go Outdated Show resolved Hide resolved
lxd/images.go Outdated Show resolved Hide resolved
lxc/image.go Outdated Show resolved Hide resolved
@gabrielmougard gabrielmougard force-pushed the fix/set-cached-false-pre-existing-image branch from 7c9eb3d to 0980bc7 Compare April 11, 2024 12:06
lxd/daemon_images.go Outdated Show resolved Hide resolved
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
…entually uncache the image

If the image already exists, is cached and that it is requested to be downloaded from an explicit `image copy` operation,
then disable its `cache` parameter so that it won't be candidate for auto removal.

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Now, only `imgPostRemoteInfo()` and `imgPostURLInfo()` calling `ImageDownload`
are used for an explicit image copy operation.

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@gabrielmougard gabrielmougard force-pushed the fix/set-cached-false-pre-existing-image branch from 0980bc7 to 35f93bb Compare April 11, 2024 12:23
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@tomponline tomponline merged commit a602804 into canonical:main Apr 11, 2024
29 checks passed
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.

lxc image copy doesnt set Cached: false for pre-existing cached image
2 participants