Skip to content

c8d: Use the same logic to get the present images#47336

Merged
thaJeztah merged 1 commit intomoby:masterfrom
rumpl:history-config
Feb 6, 2024
Merged

c8d: Use the same logic to get the present images#47336
thaJeztah merged 1 commit intomoby:masterfrom
rumpl:history-config

Conversation

@rumpl
Copy link
Member

@rumpl rumpl commented Feb 6, 2024

- What I did

Inspect and history used two different ways to find the present images. This made history fail in some cases where image inspect would work (if a configuration of a manifest wasn't found in the content store).

With this change we now use the same logic for both inspect and history.

Related change for inspect #46238

- How I did it

- How to verify it

- Description for the changelog

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

@rumpl rumpl added area/images Image Distribution containerd-integration Issues and PRs related to containerd integration labels Feb 6, 2024
@rumpl rumpl requested a review from vvoland February 6, 2024 11:30
Comment on lines 7 to 6

"github.com/containerd/containerd/images"
containerdimages "github.com/containerd/containerd/images"
Copy link
Member

Choose a reason for hiding this comment

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

LOL. Again!

We really need to look which linter we're missing that should check for this.

}

var presentImages []imagespec.DockerOCIImage
err = i.walkImageManifests(ctx, desc, func(img *ImageManifest) error {
Copy link
Member

Choose a reason for hiding this comment

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

I think there's actually a bug in this code; but I found some other code that needs to be looked at as well; see

Copy link
Member Author

Choose a reason for hiding this comment

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

I added platform filtering. Ptal


var ociimage imagespec.DockerOCIImage
if err := readConfig(ctx, i.content, conf, &ociimage); err != nil {
if cerrdefs.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

readConfig is our function and uses our errdefs 😛

Suggested change
if cerrdefs.IsNotFound(err) {
if errdefs.IsNotFound(err) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh boy, you are right

Inspect and history used two different ways to find the present images.
This made history fail in some cases where image inspect would work (if
a configuration of a manifest wasn't found in the content store).

With this change we now use the same logic for both inspect and history.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Copy link
Contributor

@vvoland vvoland 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
Copy link
Member

failures on Windows are expected with c8d snapshotters enabled. Bringing this one in

@thaJeztah thaJeztah merged commit d2f12e6 into moby:master Feb 6, 2024
@vvoland vvoland added this to the 26.0.0 milestone Feb 28, 2024
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

Projects

Development

Successfully merging this pull request may close these issues.

4 participants