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

[24.0 backport] daemon/list: Refactor refreshImage and make readConfig return errdefs #46095

Merged
merged 4 commits into from Jul 28, 2023

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Jul 28, 2023

- What I did

  • Make readConfig translate containerd NotFound into errdefs.NotFound
  • Replace ErrImageDoesNotExist check in refreshImage into errdefs.IsNotFound check (we forgot to upstream this: daemon: Replace ErrImageDoesNotExist typecheck rumpl/moby#130)
  • Refactor refreshImage - because the whole code was confusing. I added some comments and restructured it a bit.

- How I did it
See commits.

- How to verify it

- Description for the changelog

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 7379d18)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Check for generic `errdefs.NotFound` rather than specific error helper
struct when checking if the error is caused by the image not being
present.
It still works for `ErrImageDoesNotExist` because it
implements the NotFound errdefs interface too.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5a39bee)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added area/images kind/bugfix PR's that fix bugs kind/refactor PR's that refactor, or clean-up code labels Jul 28, 2023
@vvoland vvoland added this to the 24.0.6 milestone Jul 28, 2023
Add context comments and make it a bit more readable.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 68991ae)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
refreshImage is the only function used as a reducer and it doesn't use
the `filter *listContext`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 13180c1)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Copy link
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 77e2d29 into moby:24.0 Jul 28, 2023
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images kind/bugfix PR's that fix bugs kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants