-
Notifications
You must be signed in to change notification settings - Fork 752
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
Handle: add ConntrackDeleteFilter alias for backward compat #1008
Conversation
@aboch @aojea @aroradaman PTAL |
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
heh #989 (comment) /lgtm |
01d4b95
to
eb596b9
Compare
Thanks for taking care of this. I hope @aboch can release v1.2.2 promptly with this change so that people can upgrade to a new release without having to deal with breaking changes. |
// ConntrackDeleteFilter deletes entries on the specified table on the base of the filter using the netlink handle passed | ||
// conntrack -D [table] parameters Delete conntrack or expectation | ||
// | ||
// Deprecated: use [Handle.ConntrackDeleteFilters] instead. |
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.
why is this being marked as deprecated, when the top-level ConntrackDeleteFilter
function is not?
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.
My thinking here was that the new one effectively replaces the existing one. So deprecation as indication for users to move over.
I'm fine removing though (honestly I think the change in signature probably would've been fine without a rename, but I guess it could break someone trying to match against an interface)
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.
My point was that if this method is marked as deprecated, then ConntrackDeleteFilter
should also be marked as deprecated, or it's inconsistent
Line 72 in 65a253d
func ConntrackDeleteFilter(table ConntrackTableType, family InetFamily, filter CustomConntrackFilter) (uint, error) { |
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.
Ah! Sorry, misinterpreted your comment 😅
Yes, that makes sense; I pushed, and deprecated that one as well
While working on that, I also found that there c96b03b did not add stubs for non-supported platforms, so I added those as well.
We haven't found time yet to bisect/dig into, but I should mention that we also ran into other issues with this update in Moby (docker engine); moby/moby#48368 (comment) |
This is likely because of this change: acdc658 More generally, there has been quite a lot of changes to the API since the 1.2.0 release. New functions were added but there were also some "breaking" changes, most of them more subtle than just the removal of |
eb596b9
to
694b487
Compare
Thanks @antoninbas ! That sounds indeed like it's related; thanks for that pointer, I think we should be able to work with that 🫶
Yes, we stuck to a tagged version (to not force others to update), but the beta was probably tagged a bit too soon (either that, or had been around for too long, and gathered too many changes since). 1.3.0 definitely would've given more flexibility (keeping the option open to tag 1.2.x versions if needed). |
Commit c96b03b changed the signature of this method to accept a list of filters and renamed it to ConntrackDeleteFilters (plural). This patch - adds back ConntrackDeleteFilter as an alias - marks it as deprecated in favor of the new version. - adds missing stubs for other platforms Signed-off-by: Sebastiaan van Stijn <[email protected]>
694b487
to
f94e97e
Compare
Thanks @thaJeztah for adding back the Handle version of the original method. |
Mostly to keep the option open to reduce the public API in future, and to reduce maintenance (admitted, for these that's fairly limited). Deprecated doesn't have to mean "remove" immediately. Happy to remove the deprecation though if that's no concern. From a public API perspective, while looking at this, even started wondering if this change was strictly needed; the existing function accepts a custom filter, which must match an interface; a utility to construct a "compound" filter probably would've given the same (and more), e.g. |
Commit c96b03b changed the signature of this method to accept a list of filters and renamed it to ConntrackDeleteFilters (plural).
This patch adds back ConntrackDeleteFilter as an alias, and marks it as deprecated in favor of the new version.