Skip to content

Add exec_in_pod tool for command execution in Kubernetes pods #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rr-paras-patel
Copy link
Collaborator

Introduce a new tool to execute commands within Kubernetes pods, enhancing the functionality with a schema for input validation and response handling. The implementation supports both string and array command formats, along with an optional shell specification.

Copy link

@Copilot 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 adds a new tool, exec_in_pod, which enables command execution in Kubernetes pods while supporting both string and array command formats along with optional shell and container parameters. The key changes include:

  • Implementation of the exec_in_pod tool with input validation and output handling.
  • New tests to verify both array and string command executions and error handling.
  • Updates to response schemas and the main request handler to register the new tool.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/exec_in_pod.test.ts New integration tests for the exec_in_pod tool functionality.
src/tools/exec_in_pod.ts Implementation of the exec_in_pod tool using the Kubernetes Exec API.
src/models/response-schemas.ts Added ExecInPodResponseSchema to support the new tool.
src/index.ts Updated request handler to include exec_in_pod in the tool list.

Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

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

Just the comment about making timeout configurable. I think the copilot review around using ExecInPodSchema is correct too, so probably want to update that.

Everything else LGTM

@rr-paras-patel rr-paras-patel marked this pull request as ready for review April 24, 2025 05:33
@rr-paras-patel rr-paras-patel marked this pull request as draft April 24, 2025 05:33
Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

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

Code LGTM - not entirely sure whats causing the tests to fail though, once tests are fixed up can merge & make new build.

@rr-paras-patel rr-paras-patel marked this pull request as ready for review May 16, 2025 06:23
Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

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

Do you want to land this before the big refactor or after?

@Flux159
Copy link
Owner

Flux159 commented May 21, 2025

This one needs a rebase after the refactor

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