From 575f1d749d1d479987cb5765e67f81e83a4a56ea Mon Sep 17 00:00:00 2001 From: nothinux Date: Fri, 20 Jan 2023 14:22:25 +0700 Subject: [PATCH] show pod name if eviction fail --- pkg/cmd/evict.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/evict.go b/pkg/cmd/evict.go index c909d4e..84771a1 100644 --- a/pkg/cmd/evict.go +++ b/pkg/cmd/evict.go @@ -176,7 +176,7 @@ func (o *EvictOptions) RunEvict(ctx context.Context) error { for _, pod := range pods { err := eviction.EvictPod(ctx, pod, opts) if err != nil { - return err + return fmt.Errorf("pod %s/%s\n%w", pod.Namespace, pod.Name, err) } fmt.Fprintf(o.Out, "pod %s/%s %s\n", pod.Namespace, pod.Name, verb) }