-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use Vec instead of HashMap for firewall rules, don't paginate #668
Conversation
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] | ||
pub struct VpcFirewallRules { | ||
pub rules: Vec<VpcFirewallRule>, | ||
} |
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.
Maybe this should be called a VpcFirewall
and the endpoint should simply be /firewall
. That way a Firewall
is essentially the name for a collection of rules. I don't see why we would want to have multiple firewalls per VPC, but we don't have to support that. It could just be /vpc/:vpcName/firewall
and there is exactly one firewall.
bdc84cf
to
b71b40a
Compare
common/src/api/external/mod.rs
Outdated
} | ||
|
||
impl FromIterator<VpcFirewallRule> for VpcFirewallRuleUpdateResult { | ||
impl FromIterator<VpcFirewallRule> for VpcFirewallRules { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -1753,22 +1749,15 @@ impl Nexus { | |||
project_name: &Name, | |||
vpc_name: &Name, | |||
params: &VpcFirewallRuleUpdateParams, | |||
) -> UpdateResult<VpcFirewallRuleUpdateResult> { | |||
) -> UpdateResult<Vec<db::model::VpcFirewallRule>> { |
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.
functions in this file should return models
# Conflicts: # nexus/src/nexus.rs
@rmustacc this change implies a change to RFD 21. Should I open a PR there if this gets merged? |
I'm going to merge this because it's blocking me on console. I've gotten independent confirmation from @davepacheco and @rmustacc that this approach is good. I will tweak in a followup if necessary. |
@david-crespo let's get that PR open as that's the main way for us to track the actual bits that we want to have. I'll try to get through the missed discussion to make sure I'm fully up to speed. In the future, I'd prefer to see the RFD updated before we land changes like this so we don't end up churning too much. |
As discussed in the 2/4/22 control plane huddle, after working on the firewall rules UI, I found some issues that are orthogonal to and less controversial than the PUT vs. POST debate in #623.
Issues
Fixes proposed here