dedupe: record relative path for cache entries

In a production use case we found that the actual rootdir can be moved.
Currently, cache entries for dedupe record the full blob path which
doesn't work in the move use case.

Only for dedupe cache entries, record relative blob paths.
This commit is contained in:
Ramkumar Chinchani
2020-05-27 14:27:35 -07:00
parent 36efa17915
commit cb9e773a3e
3 changed files with 27 additions and 10 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package storage_test
import (
"io/ioutil"
"os"
"path"
"testing"
"github.com/anuvu/zot/errors"
@@ -33,7 +34,7 @@ func TestCache(t *testing.T) {
b := c.HasBlob("key", "value")
So(b, ShouldBeFalse)
err = c.PutBlob("key", "value")
err = c.PutBlob("key", path.Join(dir, "value"))
So(err, ShouldBeNil)
b = c.HasBlob("key", "value")