Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make uninstall more robust and informative #3618

Merged
merged 6 commits into from
Mar 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adress Ashish's second review
Signed-off-by: Carlisia <carlisia@vmware.com>
  • Loading branch information
Carlisia committed Mar 26, 2021
commit 6decba9ddaee72e00fe8430a2164ab2802e11e8d
12 changes: 3 additions & 9 deletions pkg/cmd/cli/uninstall/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,28 +147,22 @@ 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) {
carlisia marked this conversation as resolved.
Show resolved Hide resolved
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))
}

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 {
Expand Down