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
platforms: isolate from errdefs and api dependencies #9095
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This cleans up the platforms package from dependencies that are not strictly needed. This is in preparation of making this package a separate module, which can be shared by plugins, and containerd versions (as well as external consumers), - Remove dependency on the errdefs package: most uses of these error definitions were used internally, and other errors may not be useful for external consumers as sentinel errors. - ErrInvalidArgument may be a potential exception, although a look at current uses of this package shows that there's no special handling of invalid parameters vs other errors (all would boil down to "the passed platform is invalid" (either the format, or parsing is not implemented on a specific platform) - Remove uses of the convenience "Platform" alias in favor of using the upstream (from OCI spec). Consumers of this package can still use the convenience alias, but make sure that function signatures do not imply that it's a different type (which can cause confusion). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
These utilities resulted in the platforms package to have the containerd API as dependency. As this package is used in many parts of the code, as well as external consumers, we should try to keep it light on dependencies, with the potential to make it a standalone module. These utilities were added in f3b7436, which has not yet been included in a release, so skipping deprecation and aliases for these. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
isolate_platform
branch
from
September 13, 2023 14:44
92bc7cc
to
e916d77
Compare
henry118
approved these changes
Sep 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dmcgowan
approved these changes
Sep 13, 2023
fuweid
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dcantah
approved these changes
Sep 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice LGTM
estesp
approved these changes
Sep 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
platforms: remove errdefs dependency
This cleans up the platforms package from dependencies that are not strictly
needed. This is in preparation of making this package a separate module, which
can be shared by plugins, and containerd versions (as well as external consumers),
definitions were used internally, and other errors may not be useful
for external consumers as sentinel errors.
current uses of this package shows that there's no special handling of
invalid parameters vs other errors (all would boil down to "the passed
platform is invalid" (either the format, or parsing is not implemented
on a specific platform)
upstream (from OCI spec). Consumers of this package can still use the
convenience alias, but make sure that function signatures do not imply
that it's a different type (which can cause confusion).
platforms: move ToProto, FromProto to api/types
These utilities resulted in the platforms package to have the containerd
API as dependency. As this package is used in many parts of the code, as
well as external consumers, we should try to keep it light on dependencies,
with the potential to make it a standalone module.
These utilities were added in f3b7436,
which has not yet been included in a release, so skipping deprecation
and aliases for these.