Skip to content

[nexus] Apply limits to affinity group memberships#7858

Merged
smklein merged 236 commits into
mainfrom
group-size-limits
Mar 26, 2025
Merged

[nexus] Apply limits to affinity group memberships#7858
smklein merged 236 commits into
mainfrom
group-size-limits

Conversation

@smklein

@smklein smklein commented Mar 21, 2025

Copy link
Copy Markdown
Collaborator

Fixes #7627

@smklein smklein marked this pull request as ready for review March 21, 2025 22:52
@smklein smklein requested a review from david-crespo March 21, 2025 22:52
@david-crespo

Copy link
Copy Markdown
Contributor

Oh this is good. We were debating whether to bother with pagination in the console listing of instances in a group and groups for an instance, and now we definitely won't. cc @charliepark

@david-crespo david-crespo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Everything looks good. The only questions I have are

  1. Is there a better error code than 400? Probably not. For #5914 I used InvalidValue but it's still a 400, plus it works differently — it's checking the length of an array that is actually present in the JSON.
  2. It might be worth sticking the max in the doc string for the add endpoints. Kind of annoying to hard code it in two places but we will survive.
    /// Filters reduce the scope of a firewall rule. Without filters, the rule
    /// applies to all packets to the targets (or from the targets, if it's an
    /// outbound rule). With multiple filters, the rule applies only to packets
    /// matching ALL filters. The maximum number of each type of filter is 256.
    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, JsonSchema)]
    pub struct VpcFirewallRuleFilter {

@smklein

smklein commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator Author

Everything looks good. The only questions I have are

  1. Is there a better error code than 400? Probably not. For Limit number of firewall rules per VPC #5914 I used InvalidValue but it's still a 400, plus it works differently — it's checking the length of an array that is actually present in the JSON.

The other error I was considering was "InsufficientCapacity", which is 507? But that feels a little odd too; it's a limit to either the group/instance, which feels more object-specific than "server-specific".

  1. It might be worth sticking the max in the doc string for the add endpoints. Kind of annoying to hard code it in two places but we will survive.
    /// Filters reduce the scope of a firewall rule. Without filters, the rule
    /// applies to all packets to the targets (or from the targets, if it's an
    /// outbound rule). With multiple filters, the rule applies only to packets
    /// matching ALL filters. The maximum number of each type of filter is 256.
    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize, JsonSchema)]
    pub struct VpcFirewallRuleFilter {

How about I add it to the AffinityGroupMember docs? With #7864, it'll also be possible to add memberships via instance create. (see: 161d381)

Base automatically changed from groups-for-instance to main March 25, 2025 23:10
@smklein smklein merged commit 815d9a9 into main Mar 26, 2025
@smklein smklein deleted the group-size-limits branch March 26, 2025 21:25
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.

Consider adding a limit to affinity group memberships

2 participants