feat(): add hub-and-spoke topology fields to SliceConfig CRD#408
Open
Shreesha001 wants to merge 1 commit into
Open
feat(): add hub-and-spoke topology fields to SliceConfig CRD#408Shreesha001 wants to merge 1 commit into
Shreesha001 wants to merge 1 commit into
Conversation
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds Hub-and-Spoke (partial mesh MVP) API surface to the SliceConfig CRD and enforces the initial validation rules via the admission webhook, while keeping default behavior backward compatible (no spec.topology → full mesh).
Changes:
- Introduces
spec.topology(mode,hubs) in theSliceConfigGo types and CRD OpenAPI schema. - Adds create/update webhook validation for topology cross-field rules (single hub for this release, hub must be a member, etc.) with unit tests.
- Adds a Hub-and-Spoke sample
SliceConfigmanifest.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| service/slice_config_webhook_validation.go | Adds validateTopology + Hub-and-Spoke rules and wires validation into create/update paths. |
| service/slice_config_webhook_validation_test.go | Adds table-driven unit tests covering valid/invalid topology configurations. |
| config/samples/controller_v1alpha1_sliceconfig_hub_and_spoke.yaml | Adds a sample SliceConfig manifest demonstrating the new spec.topology fields. |
| config/crd/bases/controller.kubeslice.io_sliceconfigs.yaml | Extends the CRD schema with spec.topology (mode enum, hubs maxItems). |
| apis/controller/v1alpha1/zz_generated.deepcopy.go | Updates generated deepcopy functions for the new TopologySpec. |
| apis/controller/v1alpha1/sliceconfig_types.go | Adds TopologySpec / TopologyMode types and integrates them into SliceConfigSpec. |
Files not reviewed (1)
- apis/controller/v1alpha1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
4
to
7
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.19.0 | ||
| controller-gen.kubebuilder.io/version: v0.17.3 | ||
| name: sliceconfigs.controller.kubeslice.io |
Comment on lines
+3
to
+9
| # worker-1 acts as the hub; worker-2 and worker-3 become spokes (all | ||
| # non-hub members are spokes). Tunnel links are created only between | ||
| # hub and spokes: worker-1<->worker-2 and worker-1<->worker-3. | ||
| # No spoke<->spoke (worker-2<->worker-3) link is created. | ||
| # | ||
| # Omitting spec.topology entirely (or setting mode: FullMesh with no | ||
| # hubs) keeps the existing full-mesh behavior. |
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.
Adds the API for Hub-and-Spoke topology (Partial Mesh MVP), per the ADR (#300).
spec.topologyfield on SliceConfig:mode(FullMesh|HubAndSpoke) andhubs. All non-hub clusters are spokes automatically.topologyfield → existing full-mesh behavior, unchanged.Fixes #301
How Has This Been Tested?
topologyunaffected.Checklist:
Does this PR introduce a breaking change for other components like worker-operator?
No