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

[25.0 backport] don"t depend on containerd platform.Parse to return a typed error #47890

Merged

Conversation

thaJeztah
Copy link
Member

We currently depend on the containerd platform-parsing to return typed errdefs errors; the new containerd platforms module does not return such errors, and documents that errors returned should not be used as sentinel errors; https://github.com/containerd/platforms/blob/c1438e911ac7596426105350652fe267d0fb8a03/errors.go#L21-L30

Let"s type these errors ourselves, so that we don"t depend on the error-types returned by containerd, and consider that eny platform string that results in an error is an invalid parameter.

(cherry picked from commit cd1ed46)

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

We currently depend on the containerd platform-parsing to return typed
errdefs errors; the new containerd platforms module does not return such
errors, and documents that errors returned should not be used as sentinel
errors; https://github.com/containerd/platforms/blob/c1438e911ac7596426105350652fe267d0fb8a03/errors.go#L21-L30

Let"s type these errors ourselves, so that we don"t depend on the error-types
returned by containerd, and consider that eny platform string that results in
an error is an invalid parameter.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cd1ed46)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Jun 3, 2024
@thaJeztah thaJeztah added this to the 25.0.6 milestone Jun 3, 2024
@thaJeztah thaJeztah requested a review from tonistiigi as a code owner June 3, 2024 11:10
@thaJeztah thaJeztah self-assigned this Jun 3, 2024
@thaJeztah thaJeztah merged commit f26fd4a into moby:25.0 Jun 3, 2024
134 checks passed
@thaJeztah thaJeztah deleted the 25.0_backport_platforms_err_handling branch June 3, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants