complete hydration validation checks between switches and gateways#1374
Merged
complete hydration validation checks between switches and gateways#1374
Conversation
we could not check this before due to circular dependencies between gateway and fabric, but now that they everything is in fabric let's take care of this Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
|
🚀 Temp artifacts published: |
There was a problem hiding this comment.
Pull request overview
Adds cross-resource hydration/validation checks so switch and gateway ProtocolIP/VTEPIP values are globally unique across both CRDs, addressing issue #245.
Changes:
- Extend
Switch.HydrationValidationto also consider existingGatewayobjects when checkingProtocolIP/VTEPIPuniqueness (via unstructured listing to avoid package cycles). - Extend
Gateway.Validateto consider existingSwitchobjects when checkingProtocolIP/VTEPIPuniqueness. - Add/extend unit tests for gateway↔switch collision scenarios on both sides.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| api/wiring/v1beta1/switch_types.go | Lists Gateways during switch hydration validation and incorporates their IPs into uniqueness checks. |
| api/wiring/v1beta1/switch_types_test.go | Adds test cases ensuring switch hydration rejects collisions with gateway ProtocolIP/VTEPIP. |
| api/gateway/v1alpha1/gateway_types.go | Lists Switches during gateway validation to enforce shared ProtocolIP/VTEPIP uniqueness. |
| api/gateway/v1alpha1/gateway_types_test.go | Adds test cases ensuring gateway validation rejects overlaps with switch ProtocolIP/VTEPIP. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
same as the previous commit but in reverse direction. note that to avoid a dependecy cycle between wiringapi and gwapi here we use k8s unstructured lists Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
79f461d to
de8a778
Compare
|
🚀 Temp artifacts published: |
Frostman
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix https://github.com/githedgehog/internal/issues/245