storage/driver/s3: correct response on list of missing directory

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2015-11-24 14:23:12 -08:00
parent dc5b71afb0
commit 10f7b7bf95

View file

@ -685,6 +685,12 @@ func (d *driver) List(ctx context.Context, path string) ([]string, error) {
return nil, err return nil, err
} }
if len(listResponse.Contents) == 0 {
// Treat empty response as missing directory, since we don't actually
// have directories in s3.
return nil, storagedriver.PathNotFoundError{Path: path}
}
files := []string{} files := []string{}
directories := []string{} directories := []string{}