Skip to content

[27.x backport] c8d/tag: Don't log a warning if the source image is not dangling#49010

Merged
thaJeztah merged 1 commit intomoby:27.xfrom
vvoland:49009-27.x
Dec 2, 2024
Merged

[27.x backport] c8d/tag: Don't log a warning if the source image is not dangling#49010
thaJeztah merged 1 commit intomoby:27.xfrom
vvoland:49009-27.x

Conversation

@vvoland
Copy link
Copy Markdown
Contributor

@vvoland vvoland commented Dec 2, 2024

After the image is tagged, the engine attempts to delete a dangling image of the source image, so the image is no longer dangling.

When the source image is not dangling, the removal errors out (as expected), but a warning is logged to the daemon log:

time="2024-12-02T10:44:25.386957553Z" level=warning msg="unexpected error when deleting dangling image" error="NotFound: image \"moby-dangling@sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045\": not found" imageID="sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045" spanID=bd10a21a07830d72 tag="docker.io/library/test:latest" traceID=4cf61671c2dc6da3dc7a09c0c6ac4e16

Remove that log as it causes unnecessary confusion, as the failure is expected.

- What I did

- How I did it

- How to verify it

$ docker tag <tagged-image> <new-tag>
# Observe daemon logs

- Description for the changelog

containerd image store: Remove a confusing warning log when tagging a non-dangling image.

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

After the image is tagged, the engine attempts to delete a dangling
image of the source image, so the image is no longer dangling.

When the source image is not dangling, the removal errors out (as
expected), but a warning is logged to the daemon log:

```
time="2024-12-02T10:44:25.386957553Z" level=warning msg="unexpected error when deleting dangling image" error="NotFound: image \"moby-dangling@sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045\": not found" imageID="sha256:54d8c2251c811295690b53af7767ecaf246f1186c36e4f2b2a63e0bfa42df045" spanID=bd10a21a07830d72 tag="docker.io/library/test:latest" traceID=4cf61671c2dc6da3dc7a09c0c6ac4e16
```

Remove that log as it causes unnecessary confusion, as the failure is
expected.

Signed-off-by: Paweł Gronowski <[email protected]>
(cherry picked from commit a93f6c6)
Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added status/2-code-review impact/changelog area/images Image Distribution kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Dec 2, 2024
@vvoland vvoland added this to the 27.4.0 milestone Dec 2, 2024
@vvoland vvoland self-assigned this Dec 2, 2024
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah 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 1cc1274 into moby:27.x Dec 2, 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 impact/changelog kind/bugfix PR's that fix bugs status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants