Skip to content

Refactor API and update documentation with validation tests#40

Merged
k8s-ci-robot merged 13 commits intokubernetes-sigs:mainfrom
aliok:2026-03-10-crd-logical-grouping-impl
Mar 23, 2026
Merged

Refactor API and update documentation with validation tests#40
k8s-ci-robot merged 13 commits intokubernetes-sigs:mainfrom
aliok:2026-03-10-crd-logical-grouping-impl

Conversation

@aliok
Copy link
Copy Markdown
Member

@aliok aliok commented Mar 16, 2026

Fixes #32

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 16, 2026
@aliok aliok mentioned this pull request Mar 16, 2026
@ArangoGutierrez ArangoGutierrez requested a review from Copilot March 16, 2026 10:03
Copy link
Copy Markdown

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 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 MCPServerSpec to introduce source/config/runtime groupings and a new config.storage mount 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.

Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_validation_test.go
Comment thread config/crd/bases/mcp.x-k8s.io_mcpservers.yaml Outdated
Comment thread internal/controller/mcpserver_controller.go
Comment thread internal/controller/mcpserver_controller.go
Comment thread internal/controller/mcpserver_controller.go
Copy link
Copy Markdown
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

Looks good, Only one comment on my side, but I think some of the GitHub Copilot comments are worth addressing

Comment thread internal/controller/mcpserver_controller.go
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 16, 2026
@aliok aliok force-pushed the 2026-03-10-crd-logical-grouping-impl branch from e2449fe to 35ae53a Compare March 16, 2026 11:32
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 16, 2026
Copy link
Copy Markdown

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

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, and spec.runtime.security.
  • Reworks controller reconciliation to consume the new spec and implements spec.config.storage volume/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.

Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread internal/controller/mcpserver_controller.go Outdated
Comment thread internal/controller/mcpserver_controller.go Outdated
@mrunalp
Copy link
Copy Markdown
Member

mrunalp commented Mar 16, 2026

/ok-to-test

@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 16, 2026

Addressed the GitHub copilot comments.
Can you take a new look please?

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 16, 2026
Copy link
Copy Markdown

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

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.

Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_types.go Outdated
Comment thread api/v1alpha1/mcpserver_types.go
Comment thread api/v1alpha1/mcpserver_types.go Outdated
@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 17, 2026

@everettraven Thanks a lot for the review. I think I've addressed all of them!

Copy link
Copy Markdown
Contributor

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

LGTM - but let's squash the commits to tell a nice git history and then we can merge

@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 17, 2026

Gonna rebase and squash

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2026
@aliok aliok force-pushed the 2026-03-10-crd-logical-grouping-impl branch from a85daf0 to 3fd569b Compare March 17, 2026 11:38
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 17, 2026
@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 17, 2026

LGTM - but let's squash the commits to tell a nice git history and then we can merge

@ArangoGutierrez #16

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.

Comment thread api/v1alpha1/mcpserver_types.go
Comment thread examples/everything-mcp-server/mcpserver.yaml
Comment thread api/v1alpha1/mcpserver_types.go
aliok added 2 commits March 18, 2026 23:39
…onfig and SecurityConfig

Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
Comment thread api/v1alpha1/mcpserver_types.go Outdated
aliok added 2 commits March 19, 2026 10:21
Signed-off-by: Ali Ok <aliok@redhat.com>
Signed-off-by: Ali Ok <aliok@redhat.com>
@matzew
Copy link
Copy Markdown
Member

matzew commented Mar 19, 2026

/ok-to-test

…llow empty array

Signed-off-by: Ali Ok <aliok@redhat.com>
@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 19, 2026

presubmit check fails due to this:

go: no such tool "covdata"

But, please do not block this PR because of that. That's irrelevant with this PR and we can fix that separately.

@matzew
Copy link
Copy Markdown
Member

matzew commented Mar 19, 2026

go: no such tool "covdata"

I guess we should fix/remove that?

@jaideepr97
Copy link
Copy Markdown
Contributor

go: no such tool "covdata"

I guess we should fix/remove that?

#48 just merged
@matzew could you re-trigger the CI? I think it should be green now

@matzew
Copy link
Copy Markdown
Member

matzew commented Mar 19, 2026

/test presubmit-mcp-lifecycle-operator-unit-test

matzew and others added 3 commits March 19, 2026 16:47
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Signed-off-by: Matthias Wessendorf <mwessend@redhat.com>
Copy link
Copy Markdown
Member

@matzew matzew left a comment

Choose a reason for hiding this comment

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

Thanks for the work and refactorings! This looks good to me now!

/lgtm
/approve

/hold
feel free to unhold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2026
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 23, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2026
@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 23, 2026

I will wait for a few hours for @ArangoGutierrez :) I suspect he might be at KubeCon

@aliok
Copy link
Copy Markdown
Member Author

aliok commented Mar 23, 2026

/unhold

Let's create separate issues if we find anything

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2026
@k8s-ci-robot k8s-ci-robot merged commit 84db7ee into kubernetes-sigs:main Mar 23, 2026
6 checks passed
@aliok aliok deleted the 2026-03-10-crd-logical-grouping-impl branch March 23, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logical grouping of the CRD fields

9 participants