From dd06c104b452912ff8dadb85955c528bef3ae08d Mon Sep 17 00:00:00 2001 From: wangycc Date: Thu, 26 Dec 2024 17:44:53 +0800 Subject: [PATCH] Fix: Update debugger container name --- src/k8s/k8s.go | 2 +- src/plugin/plugin.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k8s/k8s.go b/src/k8s/k8s.go index c850f1f..4bc7aba 100644 --- a/src/k8s/k8s.go +++ b/src/k8s/k8s.go @@ -170,7 +170,7 @@ func (c *KubernetesClient) IsDebuggerContainerRunning(podName, namespace string) // 检查指定容器的状态 for _, container := range pod.Status.ContainerStatuses { - if container.Name == "debugger" { + if container.Name == "[pod-debugger]debugger" { return container.State.Running != nil, nil } } diff --git a/src/plugin/plugin.go b/src/plugin/plugin.go index 8aa2c8a..73e324b 100644 --- a/src/plugin/plugin.go +++ b/src/plugin/plugin.go @@ -38,7 +38,7 @@ func SpawnDebuggerPodOnSuperNode(client *k8s.KubernetesClient, helper *DebuggerP fmt.Printf("spawning debugger pod in pod %s success\n", helper.PodName) - err = client.ExecCommand(helper.PodName, helper.Namespace, "debugger", helper.Command) + err = client.ExecCommand(helper.PodName, helper.Namespace, "[pod-debugger]debugger", helper.Command) // 仅输出报错,依然根据 --rm 参数删除pod if err != nil { klog.Errorf("Error executing command: %v\n", err)