adds a ServiceAccount
attribute to the MCPServer
CRD
#1453
Merged
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.
As part of #654, we want to be able to create dedicated
ServiceAccount
's for MCP servers instead of sharing the ToolHive ProxyRunnerServiceAccount
. This PR adds theserviceAccount
attribute to theMCPServer
CRD and bumps the CRD Helm Chart version.The idea is that if a
ServiceAccount
name is given in theMCPServer
CR, ToolHive Operator will create the MCP Server pods to use it. Otherwise if the field is omitted from theMCPServer
CR, the ToolHive Operator will create theServiceAccount
automatically.Changes Breakdown
ServiceAccount
CRD attribute additionServiceAccount
if not specified in the CR, or to use it if it is specifiedpodTemplateSpec
generation logic has been refactored. Instead of directly producing the patch sent to the ProxyRunner via the--k8s-pod-patch
flag, we now use a dedicatedMCPServerPodTemplateSpecBuilder
. This builder uses.With[FieldName]
methods to construct the template spec dynamically, allowing for more complex configurations in the future. The change also makes testing easier,podTemplateSpec
creation can now be validated directly through themcpserver_podtemplatespec_builder_test.go
unit tests, rather than indirectly via higher-level stack functions.serviceAccount
test expectations to the Chainsaw E2E tests.Ref: #654