Skip to content
This repository was archived by the owner on Mar 21, 2026. It is now read-only.

chore: validate gateway group sizes#328

Merged
Frostman merged 2 commits intomasterfrom
pr/ema/validate-gw-group-size
Feb 26, 2026
Merged

chore: validate gateway group sizes#328
Frostman merged 2 commits intomasterfrom
pr/ema/validate-gw-group-size

Conversation

@edipascale
Copy link
Contributor

@edipascale edipascale commented Feb 25, 2026

do not allow the addition of a gateway to a group if the number of existing gateways in the groups is already greater or equal than the number of communities available for priority

also temporarily changes the fabricator branch ref for the vlab jobs to one where the new validate signature is used, until this is merged and bumped in fabricator

Fix #315

Copilot AI review requested due to automatic review settings February 25, 2026 13:39
@edipascale edipascale requested a review from Frostman as a code owner February 25, 2026 13:39
@github-actions
Copy link

🚀 Temp artifacts published: v0-ac5274c6b 🚀

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enforces a new admission validation rule that limits the number of gateways allowed in a gateway group based on how many BGP communities are configured (Fix #315), by wiring controller config into the Gateway webhook and Gateway validation.

Changes:

  • Pass meta.GatewayCtrlConfig into the Gateway validating webhook and into Gateway.Validate.
  • Add Gateway validation logic to reject joining a group when existing members >= configured community count.
  • Extend Gateway API validation tests with group-size scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/ctrl/gateway_wh.go Threads controller config into the Gateway webhook so admission can use config-driven validation.
cmd/main.go Passes loaded GatewayCtrlConfig into the Gateway webhook setup.
api/gateway/v1alpha1/gateway_types.go Adds group member counting and enforces max members based on configured communities.
api/gateway/v1alpha1/gateway_types_test.go Adds test coverage for “too many gateways in group” and “fits in group” cases using configured communities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

do not allow the addition of a gateway to a group if the
number of existing gateways in the groups is already greater
or equal than the number of communities available for priority

Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
@edipascale edipascale force-pushed the pr/ema/validate-gw-group-size branch from ac5274c to c4ad2c1 Compare February 25, 2026 13:49
@github-actions
Copy link

🚀 Temp artifacts published: v0-c4ad2c135 🚀

point to a branch where the new validate signature is used,
until we can merge this and bump it in fabricator

Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
Copilot AI review requested due to automatic review settings February 25, 2026 17:43
@github-actions
Copy link

🚀 Temp artifacts published: v0-1dc50667c 🚀

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Frostman Frostman merged commit a2c096f into master Feb 26, 2026
13 checks passed
@Frostman Frostman deleted the pr/ema/validate-gw-group-size branch February 26, 2026 07:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate there are less gateways in a group then communities provided

3 participants