@@ -214,7 +214,7 @@ func (r *MCPServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
214
214
215
215
// Update the MCPServer status with the service URL
216
216
if mcpServer .Status .URL == "" {
217
- mcpServer .Status .URL = createServiceURL (mcpServer .Name , mcpServer .Namespace , mcpServer .Spec .Port )
217
+ mcpServer .Status .URL = createServiceURL (mcpServer .Name , mcpServer .Namespace , mcpServer .Spec .ProxyPort )
218
218
err = r .Status ().Update (ctx , mcpServer )
219
219
if err != nil {
220
220
ctxLogger .Error (err , "Failed to update MCPServer status" )
@@ -407,13 +407,13 @@ func (r *MCPServerReconciler) deploymentForMCPServer(m *mcpv1alpha1.MCPServer) *
407
407
408
408
// Prepare container args
409
409
args := []string {"run" , "--foreground=true" }
410
- args = append (args , fmt .Sprintf ("--proxy-port=%d" , m .Spec .Port ))
410
+ args = append (args , fmt .Sprintf ("--proxy-port=%d" , m .Spec .ProxyPort ))
411
411
args = append (args , fmt .Sprintf ("--name=%s" , m .Name ))
412
412
args = append (args , fmt .Sprintf ("--transport=%s" , m .Spec .Transport ))
413
413
args = append (args , fmt .Sprintf ("--host=%s" , getProxyHost ()))
414
414
415
- if m .Spec .TargetPort != 0 {
416
- args = append (args , fmt .Sprintf ("--target-port=%d" , m .Spec .TargetPort ))
415
+ if m .Spec .McpPort != 0 {
416
+ args = append (args , fmt .Sprintf ("--target-port=%d" , m .Spec .McpPort ))
417
417
}
418
418
419
419
// Generate pod template patch for secrets and merge with user-provided patch
@@ -454,7 +454,7 @@ func (r *MCPServerReconciler) deploymentForMCPServer(m *mcpv1alpha1.MCPServer) *
454
454
// Add OAuth discovery resource URL for RFC 9728 compliance
455
455
resourceURL := m .Spec .OIDCConfig .ResourceURL
456
456
if resourceURL == "" {
457
- resourceURL = createServiceURL (m .Name , m .Namespace , m .Spec .Port )
457
+ resourceURL = createServiceURL (m .Name , m .Namespace , m .Spec .ProxyPort )
458
458
}
459
459
args = append (args , fmt .Sprintf ("--resource-url=%s" , resourceURL ))
460
460
}
@@ -626,7 +626,7 @@ func (r *MCPServerReconciler) deploymentForMCPServer(m *mcpv1alpha1.MCPServer) *
626
626
VolumeMounts : volumeMounts ,
627
627
Resources : resources ,
628
628
Ports : []corev1.ContainerPort {{
629
- ContainerPort : m .Spec .Port ,
629
+ ContainerPort : m .Spec .ProxyPort ,
630
630
Name : "http" ,
631
631
Protocol : corev1 .ProtocolTCP ,
632
632
}},
@@ -753,8 +753,8 @@ func (r *MCPServerReconciler) serviceForMCPServer(m *mcpv1alpha1.MCPServer) *cor
753
753
Spec : corev1.ServiceSpec {
754
754
Selector : ls , // Keep original labels for selector
755
755
Ports : []corev1.ServicePort {{
756
- Port : m .Spec .Port ,
757
- TargetPort : intstr .FromInt (int (m .Spec .Port )),
756
+ Port : m .Spec .ProxyPort ,
757
+ TargetPort : intstr .FromInt (int (m .Spec .ProxyPort )),
758
758
Protocol : corev1 .ProtocolTCP ,
759
759
Name : "http" ,
760
760
}},
@@ -884,7 +884,7 @@ func deploymentNeedsUpdate(deployment *appsv1.Deployment, mcpServer *mcpv1alpha1
884
884
}
885
885
886
886
// Check if the port has changed
887
- portArg := fmt .Sprintf ("--proxy-port=%d" , mcpServer .Spec .Port )
887
+ portArg := fmt .Sprintf ("--proxy-port=%d" , mcpServer .Spec .ProxyPort )
888
888
found = false
889
889
for _ , arg := range container .Args {
890
890
if arg == portArg {
@@ -937,7 +937,7 @@ func deploymentNeedsUpdate(deployment *appsv1.Deployment, mcpServer *mcpv1alpha1
937
937
}
938
938
939
939
// Check if the container port has changed
940
- if len (container .Ports ) > 0 && container .Ports [0 ].ContainerPort != mcpServer .Spec .Port {
940
+ if len (container .Ports ) > 0 && container .Ports [0 ].ContainerPort != mcpServer .Spec .ProxyPort {
941
941
return true
942
942
}
943
943
@@ -1009,12 +1009,12 @@ func deploymentNeedsUpdate(deployment *appsv1.Deployment, mcpServer *mcpv1alpha1
1009
1009
return true
1010
1010
}
1011
1011
1012
- // Check if the targetPort has changed
1013
- if mcpServer .Spec .TargetPort != 0 {
1014
- targetPortArg := fmt .Sprintf ("--target-port=%d" , mcpServer .Spec .TargetPort )
1012
+ // Check if the mcpPort has changed
1013
+ if mcpServer .Spec .McpPort != 0 {
1014
+ mcpPortArg := fmt .Sprintf ("--target-port=%d" , mcpServer .Spec .McpPort )
1015
1015
found := false
1016
1016
for _ , arg := range container .Args {
1017
- if arg == targetPortArg {
1017
+ if arg == mcpPortArg {
1018
1018
found = true
1019
1019
break
1020
1020
}
@@ -1067,7 +1067,7 @@ func deploymentNeedsUpdate(deployment *appsv1.Deployment, mcpServer *mcpv1alpha1
1067
1067
// serviceNeedsUpdate checks if the service needs to be updated
1068
1068
func serviceNeedsUpdate (service * corev1.Service , mcpServer * mcpv1alpha1.MCPServer ) bool {
1069
1069
// Check if the service port has changed
1070
- if len (service .Spec .Ports ) > 0 && service .Spec .Ports [0 ].Port != mcpServer .Spec .Port {
1070
+ if len (service .Spec .Ports ) > 0 && service .Spec .Ports [0 ].Port != mcpServer .Spec .ProxyPort {
1071
1071
return true
1072
1072
}
1073
1073
0 commit comments