Skip to content

Commit 3e7eb7a

Browse files
committed
rename sa config
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
1 parent f6ce3e8 commit 3e7eb7a

5 files changed

Lines changed: 16 additions & 17 deletions

File tree

api/v1alpha1/mcpserver_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ type MCPServerStatus struct {
211211
}
212212

213213
// MCPServerDeployment
214-
// +kubebuilder:validation:XValidation:rule="!(has(self.serviceAccountConfig) && has(self.serviceAccountName))",message="serviceAccountConfig and serviceAccountName are mutually exclusive"
214+
// +kubebuilder:validation:XValidation:rule="!(has(self.serviceAccount) && has(self.serviceAccountName))",message="serviceAccount and serviceAccountName are mutually exclusive"
215215
type MCPServerDeployment struct {
216216
// Image defines the container image to to deploy the MCP server.
217217
// +optional
@@ -264,9 +264,9 @@ type MCPServerDeployment struct {
264264
// +optional
265265
InitContainer *InitContainerConfig `json:"initContainer,omitempty"`
266266

267-
// ServiceAccountConfig defines the configuration for the ServiceAccount to be created.
267+
// ServiceAccount defines the configuration for the ServiceAccount to be created.
268268
// +optional
269-
ServiceAccountConfig *ServiceAccountConfig `json:"serviceAccountConfig,omitempty"`
269+
ServiceAccount *ServiceAccountConfig `json:"serviceAccount,omitempty"`
270270

271271
// ServiceAccountName is the name of an existing ServiceAccount to use.
272272
// +optional

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/kagent.dev_mcpservers.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,9 +1885,9 @@ spec:
18851885
type: string
18861886
type: object
18871887
type: object
1888-
serviceAccountConfig:
1889-
description: ServiceAccountConfig defines the configuration for
1890-
the ServiceAccount to be created.
1888+
serviceAccount:
1889+
description: ServiceAccount defines the configuration for the
1890+
ServiceAccount to be created.
18911891
properties:
18921892
annotations:
18931893
additionalProperties:
@@ -5244,9 +5244,8 @@ spec:
52445244
type: array
52455245
type: object
52465246
x-kubernetes-validations:
5247-
- message: serviceAccountConfig and serviceAccountName are mutually
5248-
exclusive
5249-
rule: '!(has(self.serviceAccountConfig) && has(self.serviceAccountName))'
5247+
- message: serviceAccount and serviceAccountName are mutually exclusive
5248+
rule: '!(has(self.serviceAccount) && has(self.serviceAccountName))'
52505249
httpTransport:
52515250
description: HTTPTransport defines the configuration for a Streamable
52525251
HTTP transport.

pkg/controller/mcpserver_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ var _ = ginkgo.Describe("MCPServer Controller", func() {
746746
Deployment: kagentdevv1alpha1.MCPServerDeployment{
747747
Image: "test-image:latest",
748748
Port: 3000,
749-
ServiceAccountConfig: &kagentdevv1alpha1.ServiceAccountConfig{
749+
ServiceAccount: &kagentdevv1alpha1.ServiceAccountConfig{
750750
Annotations: map[string]string{"foo": "bar"},
751751
},
752752
},

pkg/controller/transportadapter/transportadapter_translator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ func (t *transportAdapterTranslator) translateTransportAdapterServiceAccount(
374374
}
375375

376376
// Apply custom annotations and labels if provided
377-
if server.Spec.Deployment.ServiceAccountConfig != nil {
378-
if server.Spec.Deployment.ServiceAccountConfig.Annotations != nil {
379-
objectMeta.Annotations = server.Spec.Deployment.ServiceAccountConfig.Annotations
377+
if server.Spec.Deployment.ServiceAccount != nil {
378+
if server.Spec.Deployment.ServiceAccount.Annotations != nil {
379+
objectMeta.Annotations = server.Spec.Deployment.ServiceAccount.Annotations
380380
}
381-
if server.Spec.Deployment.ServiceAccountConfig.Labels != nil {
382-
objectMeta.Labels = server.Spec.Deployment.ServiceAccountConfig.Labels
381+
if server.Spec.Deployment.ServiceAccount.Labels != nil {
382+
objectMeta.Labels = server.Spec.Deployment.ServiceAccount.Labels
383383
}
384384
}
385385

0 commit comments

Comments
 (0)