fixed startCleanUp function
@@ -60,26 +60,19 @@ func (cu *Cleanup) startCleanup(forceExecute, autoAccept, skipConfirmation bool)
return err
}
- if isExecuted {
- if forceExecute {
- isExecuted = false
- } else {
+ if isExecuted && !forceExecute {
err := cu.askForConfirmation(`Your have already deleted your old Elasticsearch data.
Do you want to perform clean up again?`)
if err != nil {
return err
- } else {
- isExecuted = false
- }
}
+ skipConfirmation = true
}
- if !isExecuted {
- err := cu.runcleanUpes(autoAccept, skipConfirmation)
+ err = cu.runcleanUpes(autoAccept, skipConfirmation)
if err != nil {
return err
}
- }
return nil
}
