not empty only if there are actual files in the bucket
This commit is contained in:
@@ -557,10 +557,16 @@ func (h *S3TablesHandler) handleDeleteNamespace(w http.ResponseWriter, r *http.R
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if entry.Entry != nil && !strings.HasPrefix(entry.Entry.Name, ".") {
|
if entry.Entry != nil && !strings.HasPrefix(entry.Entry.Name, ".") {
|
||||||
|
// Only consider it a child if it's a table (has metadata) or a file.
|
||||||
|
// Empty directories left by dropped tables or S3 clients should not
|
||||||
|
// prevent the namespace from being deleted.
|
||||||
|
_, hasMetadata := entry.Entry.Extended[ExtendedKeyMetadata]
|
||||||
|
if hasMetadata || !entry.Entry.IsDirectory {
|
||||||
hasChildren = true
|
hasChildren = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user