Skip to content

Commit

Permalink
Ignore not found delete errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phillebaba committed May 29, 2024
1 parent 7cc0624 commit 54b9306
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pkg/cluster/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ func (c *Cluster) DeleteZarfNamespace(ctx context.Context) error {
spinner := message.NewProgressSpinner("Deleting the zarf namespace from this cluster")
defer spinner.Stop()

gracePeriod := int64(0)
err := c.Clientset.CoreV1().Namespaces().Delete(ctx, ZarfNamespaceName, metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod})
if err != nil && !kerrors.IsNotFound(err) {
err := c.Clientset.CoreV1().Namespaces().Delete(ctx, ZarfNamespaceName, metav1.DeleteOptions{})
if kerrors.IsNotFound(err) {
return nil
}
if err != nil {
return err
}
timer := time.NewTimer(0)
Expand Down

0 comments on commit 54b9306

Please sign in to comment.