store: simplify DeleteCompose()

The check for all image builds being either finished or failed was done
twice. Remove the second one.
This commit is contained in:
Lars Karlitski 2020-04-27 22:41:19 +02:00 committed by Tom Gundersen
parent dde3d459f5
commit 64011e3cba

View file

@ -638,14 +638,9 @@ func (s *Store) DeleteCompose(id uuid.UUID) error {
var err error
if s.stateDir != nil {
// TODO: we need to rename the files as the compose will have multiple images
for _, imageBuild := range compose.ImageBuilds {
if imageBuild.QueueStatus == common.IBFinished || imageBuild.QueueStatus == common.IBFailed {
err = os.RemoveAll(s.getComposeDirectory(id))
if err != nil {
return err
}
}
err = os.RemoveAll(s.getComposeDirectory(id))
if err != nil {
return err
}
}