Don't break `epinio uninstall` after `epinio install-ingress`
because Minio is not even installed. Although we set --ignore-not-found
in KubectlDeleteEmbeddedYaml, the removal of the Minio yamls fails when
Minio is not even installed. This commit moves the check for a Minio
namespace before the removal.
@@ -58,14 +58,6 @@ func (k Minio) PostDeleteCheck(ctx context.Context, c *kubernetes.Cluster, ui *t
func (k Minio) Delete(ctx context.Context, c *kubernetes.Cluster, ui *termui.UI) error {
ui.Note().KeeplineUnder(1).Msg("Removing Minio...")
- if out, err := helpers.KubectlDeleteEmbeddedYaml(minioTenantYAML, true); err != nil {
- return errors.Wrap(err, fmt.Sprintf("Deleting %s failed:\n%s", minioTenantYAML, out))
- }
-
- if out, err := helpers.KubectlDeleteEmbeddedYaml(minioOperatorYAML, true); err != nil {
- return errors.Wrap(err, fmt.Sprintf("Deleting %s failed:\n%s", minioOperatorYAML, out))
- }
-
existsAndOwned, err := c.NamespaceExistsAndOwned(ctx, MinioDeploymentID)
if err != nil {
return errors.Wrapf(err, "failed to check if namespace '%s' is owned or not", MinioDeploymentID)
@@ -75,6 +67,14 @@ func (k Minio) Delete(ctx context.Context, c *kubernetes.Cluster, ui *termui.UI)
return nil
}
+ if out, err := helpers.KubectlDeleteEmbeddedYaml(minioTenantYAML, true); err != nil {
+ return errors.Wrap(err, fmt.Sprintf("Deleting %s failed:\n%s", minioTenantYAML, out))
+ }
+
+ if out, err := helpers.KubectlDeleteEmbeddedYaml(minioOperatorYAML, true); err != nil {
+ return errors.Wrap(err, fmt.Sprintf("Deleting %s failed:\n%s", minioOperatorYAML, out))
+ }
+
message := "Deleting Minio operator namespace " + MinioDeploymentID
_, err = helpers.WaitForCommandCompletion(ui, message,
func() (string, error) {
