Fixes Issue#1435.

Signed-off-by: Christoph Fiehe <christoph.fiehe@eurodata.de>
This commit is contained in:
Christoph Fiehe
2025-04-14 13:20:08 +02:00
parent ab18da351d
commit 67bd15487d
2 changed files with 3 additions and 3 deletions

View File

@@ -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]
}
}

View File

@@ -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.