Skip to content

Fix StatefulSet container configuration in Kubernetes runtime#275

Merged
JAORMX merged 3 commits intomainfrom
fix-kubernetes-statefulset-container
Apr 25, 2025
Merged

Fix StatefulSet container configuration in Kubernetes runtime#275
JAORMX merged 3 commits intomainfrom
fix-kubernetes-statefulset-container

Conversation

@JAORMX
Copy link
Copy Markdown
Collaborator

@JAORMX JAORMX commented Apr 25, 2025

Description

This PR fixes an issue where StatefulSets created for MCP servers in the Kubernetes runtime were missing container configuration. The problem was in the getMCPContainer function, which was not properly handling the container list.

Changes

  • Fixed the getMCPContainer function to properly handle container lists
  • Simplified the container handling by directly using WithContainers to add the new container
  • Added tests to verify the function works correctly with multiple containers
  • Fixed linting issues

Testing

All tests are passing, including the new tests for the getMCPContainer function.

This change fixes an issue where StatefulSets created for MCP servers in the Kubernetes runtime were missing container configuration. The problem was in the getMCPContainer function, which was not properly handling the container list.

The fix simplifies the container handling by directly using WithContainers to add the new container, which properly appends it to the existing containers list.

This resolves the issue where StatefulSets were being created with empty containers.
@JAORMX JAORMX marked this pull request as draft April 25, 2025 12:05
JAORMX added 2 commits April 25, 2025 15:24
This change fixes an issue where StatefulSets created for MCP servers in the Kubernetes runtime were missing container configuration. The problem was in the getMCPContainer function, which was not properly handling the container list.

The fix:
1. Modified getMCPContainer to return nil if the container doesn't exist
2. Added configureMCPContainer function to handle container configuration
3. Added comprehensive tests for both functions
4. Added a constant for the MCP container name

This resolves the issue where StatefulSets were being created with empty containers.
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
@JAORMX JAORMX marked this pull request as ready for review April 25, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants