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

feat(CSI-244): match subnets if existing in client rule #315

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

sergeyberezansky
Copy link
Collaborator

@sergeyberezansky sergeyberezansky commented Sep 3, 2024

TL;DR

Improved NFS client group rule matching to include superset IP networks.

What changed?

  • Added IsSupersetOf method to NfsClientGroupRule to check if a rule covers a larger IP range.
  • Updated FindNfsClientGroupRulesByFilter to include rules that are supersets of the query.
  • Implemented GetMaskBits method for Network to calculate CIDR notation.
  • Enhanced ContainsIPAddress method to handle cases where CIDR parsing fails.
  • Added unit tests for the new IsSupersetOf functionality.

How to test?

  1. Run the new unit tests in nfs_test.go.
  2. Test the FindNfsClientGroupRulesByFilter function with various IP ranges and ensure it returns both exact matches and superset rules.
  3. Verify that the ContainsIPAddress method correctly identifies IP addresses within a given network range.

Why make this change?

This change improves the flexibility and accuracy of NFS client group rule matching. By including superset IP networks, the system can now identify and apply rules that cover a broader range of IP addresses, enhancing the overall functionality of the NFS access control system.

When having an extremely large Kubernetes clusters, adding node IP addresses to client group could harm the rule matching performance or hit limits on max. number of rules. This allows using a subnet addresses (those should be configured by administrator)


Copy link

graphite-app bot commented Sep 3, 2024

Graphite Automations

"Request reviewers once CI passes" took an action on this PR • (09/03/24)

1 reviewer was added to this PR based on Sergey Berezansky's automation.

@sergeyberezansky sergeyberezansky added the enhancement New feature or request label Sep 10, 2024
@sergeyberezansky sergeyberezansky force-pushed the sergey/nfs_superset_rules branch 2 times, most recently from 66c002c to a718c35 Compare September 11, 2024 13:01
@sergeyberezansky sergeyberezansky changed the base branch from sergey/nfs_support to sergey/modify-default-hostports September 11, 2024 13:01
Copy link
Collaborator Author

sergeyberezansky commented Sep 12, 2024

Merge activity

  • Sep 12, 6:10 AM EDT: @sergeyberezansky started a stack merge that includes this pull request via Graphite.
  • Sep 12, 6:57 AM EDT: Graphite rebased this pull request as part of a merge.
  • Sep 12, 6:59 AM EDT: Graphite rebased this pull request as part of a merge.
  • Sep 12, 7:04 AM EDT: @sergeyberezansky merged this pull request with Graphite.

@sergeyberezansky sergeyberezansky changed the base branch from sergey/modify-default-hostports to graphite-base/315 September 12, 2024 10:35
@sergeyberezansky sergeyberezansky changed the base branch from graphite-base/315 to dev September 12, 2024 10:54
@sergeyberezansky sergeyberezansky merged commit 926d473 into dev Sep 12, 2024
11 checks passed
@sergeyberezansky sergeyberezansky deleted the sergey/nfs_superset_rules branch September 12, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant