diff --git a/s3/public.go b/s3/public.go index 47623a00..234a4b22 100644 --- a/s3/public.go +++ b/s3/public.go @@ -338,7 +338,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, poolPath := filepath.Join(storage.prefix, relPath) if storage.pathCache == nil { - paths, md5s, err := storage.internalFilelist(filepath.Join(storage.prefix, publishedPrefix, "pool"), true) + paths, md5s, err := storage.internalFilelist(filepath.Join(publishedPrefix, "pool"), true) if err != nil { return errors.Wrap(err, "error caching paths under prefix") } @@ -346,7 +346,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath, storage.pathCache = make(map[string]string, len(paths)) for i := range paths { - storage.pathCache[paths[i]] = md5s[i] + storage.pathCache[filepath.Join("pool", paths[i])] = md5s[i] } } diff --git a/s3/public_test.go b/s3/public_test.go index 83605e3e..a6631dad 100644 --- a/s3/public_test.go +++ b/s3/public_test.go @@ -370,7 +370,7 @@ func (s *PublishedStorageSuite) TestLinkFromPoolCache(c *C) { // Check only one listing request was done to the server s.checkGetRequestsEqual(c, "/test?", []string{ - "/test?list-type=2&max-keys=1000&prefix=lala%2Flala%2Fpool%2F", + "/test?list-type=2&max-keys=1000&prefix=lala%2Fpool%2F", }) // Publish two packages at a prefixed storage plus a publish prefix.