Skip to content

[24.0 backport] Make sure the image is unpacked for the current snapshotter#45678

Merged
thaJeztah merged 1 commit intomoby:24.0from
thaJeztah:24.0_backport_fix_snapshotter_change
Jun 2, 2023
Merged

[24.0 backport] Make sure the image is unpacked for the current snapshotter#45678
thaJeztah merged 1 commit intomoby:24.0from
thaJeztah:24.0_backport_fix_snapshotter_change

Conversation

@thaJeztah
Copy link
Member

Switching snapshotter implementations would result in an error when preparing a snapshot, check that the image is indeed unpacked for the current snapshot before trying to prepare a snapshot.

(cherry picked from commit ed32f5e)


- What I did

Changing the snapshotter would result in docker re-pulling the image because the PrepareSnapshot method would return an error. We make sure that the image we want to prepare a snapshot for is indeed unpacked for the current snapshotter before preparing it.

Relates to #45273

- How I did it

- How to verify it

  • start dockerd with the overlayfs snapshotter
  • run an image docker run --rm hello-world
  • restart dockerd and change the snapshotter (use native for example)
  • run docker images, you should see the hello-world image in the list
  • run the image: docker run --rm hello-world, docker should just run the image without re-pulling it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Switching snapshotter implementations would result in an error when
preparing a snapshot, check that the image is indeed unpacked for the
current snapshot before trying to prepare a snapshot.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
(cherry picked from commit ed32f5e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review area/images Image Distribution kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Jun 1, 2023
@thaJeztah thaJeztah added this to the 24.0.3 milestone Jun 1, 2023
@thaJeztah thaJeztah requested review from laurazard and rumpl June 1, 2023 20:53
Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 4b3329d into moby:24.0 Jun 2, 2023
@thaJeztah thaJeztah deleted the 24.0_backport_fix_snapshotter_change branch June 2, 2023 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Distribution containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs status/4-merge

Projects

Development

Successfully merging this pull request may close these issues.

4 participants