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

Remove hcsshim import from repo #10

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

kiashok
Copy link
Contributor

@kiashok kiashok commented May 30, 2024

Move windows CheckHostAndContainerCompat() function from hcsshim locally to platform repo itself

@kiashok kiashok marked this pull request as ready for review May 30, 2024 18:27
@kiashok kiashok force-pushed the remove-hcsshim-import branch 2 times, most recently from 9df5dad to 7e7a27f Compare May 30, 2024 18:34
@kiashok kiashok requested a review from dmcgowan May 30, 2024 18:35
@thaJeztah
Copy link
Member

Wondering if we should just copy the whole osversion package as a package in this repository; that way we could possibly automate updating it, and it could be used as a drop-in replacement for the existing package in places where it's used. Would that be an option?

@kiashok
Copy link
Contributor Author

kiashok commented May 30, 2024

Wondering if we should just copy the whole osversion package as a package in this repository; that way we could possibly automate updating it, and it could be used as a drop-in replacement for the existing package in places where it's used. Would that be an option?

osversion package is used quite a bit on hcsshim repo and I don't think we want to copy it over to containerd/platforms. Having it in hcsshim repo also gives us the ability to extend/add functionality instead of opening PRs on the containerd/platform repo.
It has very windows specific stuff as well and I am not sure this repo would be the right place. Also, it could break a lot of ppl who are already using osversion package directly from hcsshim.

defaults_windows.go Outdated Show resolved Hide resolved
@dmcgowan
Copy link
Member

Thanks for opening this. The needed logic is small enough that we should just maintain it here. Can we get away with making the os version struct and all the functions that use it private, that would help us make sure this package isn't getting used just for handling the version strings.

@thaJeztah
Copy link
Member

Also, it could break a lot of ppl who are already using osversion package directly from hcsshim.

So, I don't think we want to remove it there, but importing hcsshim just for that package is usually problematic, and if updates are needed from the osversion package currently means updating all of hcsshim.

This PR will help a lot in that respect, but my thinking was if it would mirror the essentials (so all the consts, and, basically a mirror of the upstream package), that could allow easier updating, and provide github.com/containerd/platforms/osversion as a "drop-in" replacements for situations where importing hcsshim is problematic.

Having it in a osversion package in this repository may me nice?

@kiashok kiashok force-pushed the remove-hcsshim-import branch from 7e7a27f to 5a36c05 Compare May 30, 2024 20:40
@kiashok
Copy link
Contributor Author

kiashok commented May 30, 2024

Also, it could break a lot of ppl who are already using osversion package directly from hcsshim.

So, I don't think we want to remove it there, but importing hcsshim just for that package is usually problematic, and if updates are needed from the osversion package currently means updating all of hcsshim.

This PR will help a lot in that respect, but my thinking was if it would mirror the essentials (so all the consts, and, basically a mirror of the upstream package), that could allow easier updating, and provide github.com/containerd/platforms/osversion as a "drop-in" replacements for situations where importing hcsshim is problematic.

Having it in a osversion package in this repository may me nice?

The change that is needed by containerd is only the one function for platform matching code. I don't think we want to maintain a mirror of the whole osversion package from hcsshim and add more maintenance of keeping it upto date etc. The only reason checkHostAndContainerCompat() was that platforms package was part of containerd/containerd repo which already needs to import hcsshim. Since that has changed now, it will be easier to just maintain that single function in containerd/platforms.

@kiashok
Copy link
Contributor Author

kiashok commented May 30, 2024

cc @kevpar @helsaawy for awareness

@kiashok
Copy link
Contributor Author

kiashok commented May 30, 2024

Thanks for opening this. The needed logic is small enough that we should just maintain it here. Can we get away with making the os version struct and all the functions that use it private, that would help us make sure this package isn't getting used just for handling the version strings.

Updated PR with changes.

@kiashok kiashok force-pushed the remove-hcsshim-import branch 2 times, most recently from 1624683 to 92f15bb Compare May 30, 2024 21:38
Move windows CheckHostAndContainerCompat() function from hcsshim
locally to platform repo itself

Signed-off-by: Kirtana Ashok <[email protected]>
@kiashok kiashok force-pushed the remove-hcsshim-import branch from 92f15bb to f680838 Compare May 30, 2024 21:41
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.

ok, let's move forward with this, thanks!

LGTM

@kiashok
Copy link
Contributor Author

kiashok commented Jun 10, 2024

@dmcgowan could this PR be merged? Thanks!

Copy link
Member

@dims dims left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan merged commit 163df76 into containerd:main Jun 10, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants