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:
parent
dde3d459f5
commit
64011e3cba
1 changed files with 3 additions and 8 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue