Refactor API and update documentation with validation tests#40
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the MCPServer CRD/API to use logical groupings (spec.source, spec.config, spec.runtime) and updates the controller, examples, and docs accordingly, with added CRD validation coverage (Issue #32).
Changes:
- Refactor
MCPServerSpecto introducesource/config/runtimegroupings and a newconfig.storagemount model. - Update controller reconciliation logic and existing controller tests to the new spec shape.
- Update CRD/schema, samples/examples, and README documentation; add envtest-based validation tests for new CRD rules.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/mcpserver_controller.go | Switch controller to spec.source + spec.config + spec.runtime, implement config.storage → volumes/mounts |
| internal/controller/mcpserver_controller_test.go | Update controller tests to new spec shape; remove old SecretRef mount test block |
| api/v1alpha1/mcpserver_types.go | Introduce new API types (Source, ServerConfig, StorageMount, RuntimeConfig) and move fields into groups |
| api/v1alpha1/zz_generated.deepcopy.go | Regenerate deepcopy implementations for new API types |
| api/v1alpha1/mcpserver_validation_test.go | Add envtest suite to verify CRD validation rules (source/storage/port/ref) |
| config/crd/bases/mcp.x-k8s.io_mcpservers.yaml | Update CRD schema, printcolumns, and validations for new grouped spec |
| config/samples/mcp_v1alpha1_mcpserver.yaml | Update sample manifest to new spec structure |
| examples/kubernetes-mcp-server/*.yaml | Update example manifests to source/config/runtime and config.storage |
| examples/kubernetes-mcp-server/README.md | Update example documentation to match new spec fields |
| examples/everything-mcp-server/mcpserver.yaml | Update example manifest to new spec structure |
| README.md | Update top-level documentation examples to new spec structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
ArangoGutierrez
left a comment
There was a problem hiding this comment.
Looks good, Only one comment on my side, but I think some of the GitHub Copilot comments are worth addressing
e2449fe to
35ae53a
Compare
There was a problem hiding this comment.
Pull request overview
Refactors the MCPServer CRD/API to logically group fields (source/config/runtime) and updates the controller, examples, and tests accordingly (Issue #32).
Changes:
- Restructures MCPServer spec to use
spec.source,spec.config, andspec.runtime.security. - Reworks controller reconciliation to consume the new spec and implements
spec.config.storagevolume/mount generation with existence checks. - Updates examples/docs and adds CRD schema validation tests plus new controller tests for storage mounts.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/mcpserver_controller.go | Updates Deployment/Service creation to use new source/config/runtime API and new storage mount processing. |
| internal/controller/mcpserver_controller_test.go | Migrates controller tests to new spec and adds reconciliation assertions for storage mounts. |
| api/v1alpha1/mcpserver_types.go | Introduces new API types (Source/Config/Runtime/StorageMount) and validation annotations. |
| api/v1alpha1/zz_generated.deepcopy.go | Regenerates deepcopy implementations for the new API types. |
| api/v1alpha1/mcpserver_validation_test.go | Adds envtest-backed tests validating CRD schema rules for the new spec structure. |
| config/crd/bases/mcp.x-k8s.io_mcpservers.yaml | Updates CRD schema, validations, and printcolumns to match the new grouped fields. |
| config/samples/mcp_v1alpha1_mcpserver.yaml | Updates the sample MCPServer manifest to the new API shape. |
| examples/kubernetes-mcp-server/mcpserver.yaml | Updates example manifest to use spec.source + spec.config. |
| examples/kubernetes-mcp-server/mcpserver-with-config.yaml | Updates ConfigMap-mount example to use spec.config.storage + spec.config.arguments. |
| examples/kubernetes-mcp-server/mcpserver-with-rbac.yaml | Updates RBAC example to use spec.runtime.security.serviceAccountName and storage mounts. |
| examples/kubernetes-mcp-server/README.md | Updates example documentation to reflect the new storage/arguments/runtime fields. |
| examples/everything-mcp-server/mcpserver.yaml | Updates example manifest to the new API shape. |
| README.md | Updates top-level README examples to the new API shape. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/ok-to-test |
|
Addressed the GitHub copilot comments. |
everettraven
left a comment
There was a problem hiding this comment.
I wasn't able to get through the entire PR as I had something come up in the middle of reviewing, but wanted to leave the comments I did have.
I'll pick this review back up first thing in the morning.
|
@everettraven Thanks a lot for the review. I think I've addressed all of them! |
ArangoGutierrez
left a comment
There was a problem hiding this comment.
LGTM - but let's squash the commits to tell a nice git history and then we can merge
|
Gonna rebase and squash |
a85daf0 to
3fd569b
Compare
I think the PR should still have individual commits - as many as the author likes - and when we merge, we should squash them. Curious people can go to the PR and check individual commits that way. |
Signed-off-by: Ali Ok <aliok@redhat.com>
…onfig and SecurityConfig Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
|
/ok-to-test |
…llow empty array Signed-off-by: Ali Ok <aliok@redhat.com>
|
But, please do not block this PR because of that. That's irrelevant with this PR and we can fix that separately. |
I guess we should fix/remove that? |
|
/test presubmit-mcp-lifecycle-operator-unit-test |
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Fix samples and RBAC
matzew
left a comment
There was a problem hiding this comment.
Thanks for the work and refactorings! This looks good to me now!
/lgtm
/approve
/hold
feel free to unhold
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aliok, matzew The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I will wait for a few hours for @ArangoGutierrez :) I suspect he might be at KubeCon |
|
/unhold Let's create separate issues if we find anything |
Fixes #32