Skip to content

Commit d62a8d9

Browse files
calmkartaylei
authored andcommitted
FIX:no permission to delete agentpod get panic error issue#38 (#70)
1 parent f08222f commit d62a8d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ vendor/
77
/debug-agent
88
/kubectl-debug
99
dist/
10+
.vscode/

pkg/plugin/cmd.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func (o *DebugOptions) Run() error {
405405
sizeQueue = t.MonitorSize(t.GetSize())
406406
// unset p.Err if it was previously set because both stdout and stderr go over p.Out when tty is
407407
// true
408-
o.ErrOut = nil
408+
// o.ErrOut = nil
409409
}
410410

411411
if o.PortForward {
@@ -787,6 +787,6 @@ func (o *DebugOptions) deleteAgent(agentPod *corev1.Pod) {
787787
}
788788
err := o.CoreClient.Pods(agentPod.Namespace).Delete(agentPod.Name, v1.NewDeleteOptions(0))
789789
if err != nil {
790-
fmt.Fprintf(o.ErrOut, "failed to delete agent pod[Name:%s, Namespace: %s], consider manual deletion.\n", agentPod.Name, agentPod.Namespace)
790+
fmt.Fprintf(o.ErrOut, "failed to delete agent pod[Name:%s, Namespace: %s], consider manual deletion.\nerror msg: %v", agentPod.Name, agentPod.Namespace, err)
791791
}
792792
}

0 commit comments

Comments
 (0)