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

Support for quota as object #244

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Conversation

turekt
Copy link
Contributor

@turekt turekt commented Oct 22, 2023

Hi,

I have added support for quota objects as stated in #238.

One thing to note: I have implemented this object type in a way that aligns with the existing implementation approach of counter object that is already implemented in this lib. It might be good to reconsider the existing implementation approach since object data can be specified as references to existing expression structs implemented in expr package and the expression data marshal logic could be reused. At the moment this requires careful rewrite of larger parts of code (expr.Any interface where marshaling of the object should be separated from marshaling of the complete expression and nftables.Obj interface implementation at the very least) and seems a bit complex since it easily breaks backwards compatibility. Current implementation should work for the time being.

Let me know what you think.

Fixes google#238
Adds quota object
Updated tests
@stapelberg
Copy link
Collaborator

One thing to note: I have implemented this object type in a way that aligns with the existing implementation approach of counter object that is already implemented in this lib. It might be good to reconsider the existing implementation approach since object data can be specified as references to existing expression structs implemented in expr package and the expression data marshal logic could be reused. At the moment this requires careful rewrite of larger parts of code (expr.Any interface where marshaling of the object should be separated from marshaling of the complete expression and nftables.Obj interface implementation at the very least) and seems a bit complex since it easily breaks backwards compatibility. Current implementation should work for the time being.

Could you file a separate issue for this refactoring idea, perhaps with a bit of draft code to illustrate what it would look like? Thanks :)

@stapelberg stapelberg merged commit 0f60df6 into google:main Dec 12, 2023
@stapelberg
Copy link
Collaborator

Hey @turekt could you contact me via email for a question please? Email michael AT stapelberg DOT ch; thank you :)

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.

2 participants