Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
EVEREST-838 delete everest system during uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
recharte committed Feb 13, 2024
1 parent 472a8ad commit 382fe7b
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions pkg/uninstall/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ This will uninstall Everest and all its components from the cluster.`
return err
}

if err := u.checkResourcesExist(ctx); err != nil {
return err
}
if err := u.kubeClient.DeleteEverest(ctx, install.SystemNamespace); err != nil {
// All resources with finalizers in the system namespace (DBCs and
// BackupStorages) have already been deleted, so we can delete the
// namespace directly
if err := u.deleteNamespaces(ctx, []string{install.SystemNamespace}); err != nil {
return err
}

Expand Down Expand Up @@ -294,18 +294,3 @@ func (u *Uninstall) deleteBackupStorages(ctx context.Context) error {
}
}
}

func (u *Uninstall) checkResourcesExist(ctx context.Context) error {
_, err := u.kubeClient.GetNamespace(ctx, install.SystemNamespace)
if err != nil && k8serrors.IsNotFound(err) {
return fmt.Errorf("namespace %s is not found", install.SystemNamespace)
}
if err != nil && !k8serrors.IsNotFound(err) {
return err
}
_, err = u.kubeClient.GetDeployment(ctx, kubernetes.PerconaEverestDeploymentName, install.SystemNamespace)
if err != nil && k8serrors.IsNotFound(err) {
return fmt.Errorf("no Everest deployment in %s namespace", install.SystemNamespace)
}
return err
}

0 comments on commit 382fe7b

Please sign in to comment.