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)