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

Add support for standalone Distributed Firewall Rule management #587

Merged
merged 14 commits into from
Jul 14, 2023

Conversation

Didainius
Copy link
Collaborator

@Didainius Didainius commented Jul 3, 2023

This PR improves NSX-T Distributed Firewall Rule management.
VCD APIs do not provide a mechanism to create a single firewall rule, only all of them at once. This PR introduces types and methods for managing Distributed Firewall Rules one by one.

The main thing to note is that VdcGroup.CreateDistributedFirewallRule still leverages the API endpoint for "update all", but does the work of merging rules, preserving their order, using json.RawMessage instead of exact types to prevent altering rules in any way now and in future.

Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Didainius added 7 commits July 3, 2023 22:44
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
@Didainius Didainius marked this pull request as ready for review July 5, 2023 07:49
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

This PR is close to magick. For some reason, you have two like that this week already (first was the partial matching of IP ranges in #1062) :) Hence, sharing some thoughts in-line.

.changes/v2.21.0/587-features.md Outdated Show resolved Hide resolved
govcd/nsxt_distributed_firewall.go Outdated Show resolved Hide resolved
govcd/nsxt_distributed_firewall.go Outdated Show resolved Hide resolved
govcd/nsxt_distributed_firewall.go Show resolved Hide resolved
govcd/nsxt_distributed_firewall.go Show resolved Hide resolved
govcd/nsxt_distributed_firewall_test.go Show resolved Hide resolved
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

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

Just some really minor things. Other than that, great PR. The wrapper is really smart.

govcd/nsxt_distributed_firewall_test.go Outdated Show resolved Hide resolved
govcd/nsxt_distributed_firewall_test.go Outdated Show resolved Hide resolved
govcd/nsxt_distributed_firewall_test.go Outdated Show resolved Hide resolved
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
Copy link

@adezxc adezxc left a comment

Choose a reason for hiding this comment

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

Great implementation!

@Didainius Didainius merged commit a329d75 into vmware:main Jul 14, 2023
@Didainius Didainius deleted the nsxt-dfw-update branch July 14, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants