Merge pull request #9187 from vvoland/remotes-docker-mounted-fix
remotes/docker: Fix MountedFrom prefixed with target repository
This commit is contained in:
commit
5b097a0817
@ -188,7 +188,7 @@ func (p dockerPusher) push(ctx context.Context, desc ocispec.Descriptor, ref str
|
|||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
resp = nil
|
resp = nil
|
||||||
case http.StatusCreated:
|
case http.StatusCreated:
|
||||||
mountedFrom = path.Join(p.refspec.Locator, fromRepo)
|
mountedFrom = path.Join(p.refspec.Hostname(), fromRepo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,9 +163,9 @@ func samplePusher(t *testing.T) (dockerPusher, *uploadableMockRegistry, StatusTr
|
|||||||
return dockerPusher{
|
return dockerPusher{
|
||||||
dockerBase: &dockerBase{
|
dockerBase: &dockerBase{
|
||||||
refspec: reference.Spec{
|
refspec: reference.Spec{
|
||||||
Locator: "sample",
|
Locator: "example.com/samplerepository:latest",
|
||||||
},
|
},
|
||||||
repository: "sample",
|
repository: "samplerepository",
|
||||||
hosts: []RegistryHost{
|
hosts: []RegistryHost{
|
||||||
{
|
{
|
||||||
Client: s.Client(),
|
Client: s.Client(),
|
||||||
@ -176,7 +176,7 @@ func samplePusher(t *testing.T) (dockerPusher, *uploadableMockRegistry, StatusTr
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
object: "sample",
|
object: "latest",
|
||||||
tracker: tracker,
|
tracker: tracker,
|
||||||
}, reg, tracker, s.Close
|
}, reg, tracker, s.Close
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ func Test_dockerPusher_push(t *testing.T) {
|
|||||||
ref: fmt.Sprintf("layer2-%s", layerContentDigest.String()),
|
ref: fmt.Sprintf("layer2-%s", layerContentDigest.String()),
|
||||||
unavailableOnFail: false,
|
unavailableOnFail: false,
|
||||||
annotations: map[string]string{
|
annotations: map[string]string{
|
||||||
distributionSourceLabelKey("sample"): "always-mount",
|
distributionSourceLabelKey("example.com"): "always-mount",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
checkerFunc: func(writer *pushWriter) bool {
|
checkerFunc: func(writer *pushWriter) bool {
|
||||||
@ -368,7 +368,7 @@ func Test_dockerPusher_push(t *testing.T) {
|
|||||||
},
|
},
|
||||||
wantErr: fmt.Errorf("content %v on remote: %w", digest.FromBytes(layerContent), errdefs.ErrAlreadyExists),
|
wantErr: fmt.Errorf("content %v on remote: %w", digest.FromBytes(layerContent), errdefs.ErrAlreadyExists),
|
||||||
wantStatus: &PushStatus{
|
wantStatus: &PushStatus{
|
||||||
MountedFrom: "sample/always-mount",
|
MountedFrom: "example.com/always-mount",
|
||||||
Exists: false,
|
Exists: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -383,7 +383,7 @@ func Test_dockerPusher_push(t *testing.T) {
|
|||||||
ref: fmt.Sprintf("layer3-%s", layerContentDigest.String()),
|
ref: fmt.Sprintf("layer3-%s", layerContentDigest.String()),
|
||||||
unavailableOnFail: false,
|
unavailableOnFail: false,
|
||||||
annotations: map[string]string{
|
annotations: map[string]string{
|
||||||
distributionSourceLabelKey("sample"): "never-mount",
|
distributionSourceLabelKey("example.com"): "never-mount",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
checkerFunc: func(writer *pushWriter) bool {
|
checkerFunc: func(writer *pushWriter) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user