From 6decba9ddaee72e00fe8430a2164ab2802e11e8d Mon Sep 17 00:00:00 2001 From: Carlisia Date: Thu, 25 Mar 2021 17:21:23 -0700 Subject: [PATCH] Adress Ashish's second review Signed-off-by: Carlisia --- pkg/cmd/cli/uninstall/uninstall.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/cli/uninstall/uninstall.go b/pkg/cmd/cli/uninstall/uninstall.go index 3201baf5e..f5cdf409c 100644 --- a/pkg/cmd/cli/uninstall/uninstall.go +++ b/pkg/cmd/cli/uninstall/uninstall.go @@ -147,12 +147,12 @@ func Run(ctx context.Context, client *kubernetes.Clientset, extensionsClient *ap defer cancel() checkFunc := func() { - ns, _ := client.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{}) + ns, err := client.CoreV1().Namespaces().Get(ctx, namespace, metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { - fmt.Printf("Unexpectedly not able to retrieve namespace %q for checking its status. Halting.\n", namespace) - errs = append(errs, errors.WithStack(err)) + fmt.Print("\n") cancel() + return } errs = append(errs, errors.WithStack(err)) } @@ -160,15 +160,9 @@ func Run(ctx context.Context, client *kubernetes.Clientset, extensionsClient *ap if ns.Status.Phase == corev1.NamespaceTerminating { fmt.Print(".") } - - if ns.Status.Phase != corev1.NamespaceTerminating { - fmt.Print("\n") - cancel() - } } wait.Until(checkFunc, 5*time.Millisecond, ctx.Done()) - } if kubeerrs.NewAggregate(errs) != nil {