Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCommandExecutorFunc ¶
func CreateCommandExecutorFunc(cmd string) tools.CommandExecutorFunc
CreateCommandExecutorFunc creates a CommandExecutor for a specific kubectl command
func RegisterKubectl ¶
RegisterKubectl registers the generic kubectl tool (legacy)
func RegisterKubectlCommand ¶
func RegisterKubectlCommand(cmd KubectlCommand) mcp.Tool
RegisterKubectlCommand registers a specific kubectl command as an MCP tool
Types ¶
type KubectlCommand ¶
type KubectlCommand struct {
Name string
Description string
ArgsExample string // Example of command arguments, such as "pods" or "-f deployment.yaml"
}
KubectlCommand defines a specific kubectl command to be registered as a tool
func GetAdminKubectlCommands ¶
func GetAdminKubectlCommands() []KubectlCommand
GetAdminKubectlCommands returns all admin kubectl commands
func GetReadOnlyKubectlCommands ¶
func GetReadOnlyKubectlCommands() []KubectlCommand
GetReadOnlyKubectlCommands returns all read-only kubectl commands
func GetReadWriteKubectlCommands ¶
func GetReadWriteKubectlCommands() []KubectlCommand
GetReadWriteKubectlCommands returns all read-write kubectl commands
type KubectlExecutor ¶
type KubectlExecutor struct{}
KubectlExecutor implements the CommandExecutor interface for kubectl commands
func NewExecutor ¶
func NewExecutor() *KubectlExecutor
NewExecutor creates a new KubectlExecutor instance
func (*KubectlExecutor) Execute ¶
func (e *KubectlExecutor) Execute(params map[string]interface{}, cfg *config.ConfigData) (string, error)
Execute handles general kubectl command execution (for backward compatibility)
func (*KubectlExecutor) ExecuteSpecificCommand ¶
func (e *KubectlExecutor) ExecuteSpecificCommand(cmd string, params map[string]interface{}, cfg *config.ConfigData) (string, error)
ExecuteSpecificCommand executes a specific kubectl command with the given arguments