Skip to content

complete hydration validation checks between switches and gateways#1374

Merged
Frostman merged 2 commits intomasterfrom
ema/complete-hydration-validation
Mar 23, 2026
Merged

complete hydration validation checks between switches and gateways#1374
Frostman merged 2 commits intomasterfrom
ema/complete-hydration-validation

Conversation

@edipascale
Copy link
Contributor

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>
@edipascale edipascale requested a review from a team as a code owner March 23, 2026 09:18
@github-actions
Copy link

🚀 Temp artifacts published: v0-79f461d52 🚀

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

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.HydrationValidation to also consider existing Gateway objects when checking ProtocolIP/VTEPIP uniqueness (via unstructured listing to avoid package cycles).
  • Extend Gateway.Validate to consider existing Switch objects when checking ProtocolIP/VTEPIP uniqueness.
  • 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>
@edipascale edipascale force-pushed the ema/complete-hydration-validation branch from 79f461d to de8a778 Compare March 23, 2026 10:16
@github-actions
Copy link

🚀 Temp artifacts published: v0-de8a77872 🚀

@Frostman Frostman merged commit a9b168e into master Mar 23, 2026
16 checks passed
@Frostman Frostman deleted the ema/complete-hydration-validation branch March 23, 2026 16:03
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.

3 participants