api: use blob cache path while making hard link

previously mount blob will look for blob that is provided in http request and try to hard link that path
but ideally we should look for path from our cache and do the hard link of that particular path.
this commit does the same.
This commit is contained in:
Shivam Mishra
2021-06-29 11:45:01 -07:00
committed by Ramkumar Chinchani
parent 3a59b9f487
commit af30c06aff
4 changed files with 65 additions and 44 deletions
+4 -4
View File
@@ -102,7 +102,7 @@ func TestAPIs(t *testing.T) {
So(err, ShouldBeNil)
So(b, ShouldEqual, l)
_, _, err = il.CheckBlob("test", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
_, _, err = il.CheckBlob("test", d.String())
So(err, ShouldBeNil)
_, _, err = il.GetBlob("test", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
@@ -201,7 +201,7 @@ func TestAPIs(t *testing.T) {
So(err, ShouldBeNil)
So(b, ShouldEqual, l)
_, _, err = il.CheckBlob("test", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
_, _, err = il.CheckBlob("test", d.String())
So(err, ShouldBeNil)
_, _, err = il.GetBlob("test", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
@@ -363,7 +363,7 @@ func TestAPIs(t *testing.T) {
So(err, ShouldBeNil)
So(b, ShouldEqual, l)
_, _, err = il.CheckBlob("dedupe1", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
_, _, err = il.CheckBlob("dedupe1", d.String())
So(err, ShouldBeNil)
_, _, err = il.GetBlob("dedupe1", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
@@ -412,7 +412,7 @@ func TestAPIs(t *testing.T) {
So(err, ShouldBeNil)
So(b, ShouldEqual, l)
_, _, err = il.CheckBlob("dedupe2", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")
_, _, err = il.CheckBlob("dedupe2", d.String())
So(err, ShouldBeNil)
_, _, err = il.GetBlob("dedupe2", d.String(), "application/vnd.oci.image.layer.v1.tar+gzip")