Remove Name from Layer and LayerUpload interface
A Layer or LayerUpload should not be coupled with the containing repository. Remove the Name method and correctly reference from the repository where appropriate. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
553d48d618
commit
09bf752234
4 changed files with 4 additions and 15 deletions
|
@ -27,11 +27,6 @@ type layerUploadController struct {
|
|||
|
||||
var _ distribution.LayerUpload = &layerUploadController{}
|
||||
|
||||
// Name of the repository under which the layer will be linked.
|
||||
func (luc *layerUploadController) Name() string {
|
||||
return luc.layerStore.repository.Name()
|
||||
}
|
||||
|
||||
// UUID returns the identifier for this upload.
|
||||
func (luc *layerUploadController) UUID() string {
|
||||
return luc.uuid
|
||||
|
@ -194,7 +189,7 @@ func (luc *layerUploadController) moveLayer(dgst digest.Digest) error {
|
|||
// named repository for the upload controller.
|
||||
func (luc *layerUploadController) linkLayer(digest digest.Digest) error {
|
||||
layerLinkPath, err := luc.layerStore.repository.registry.pm.path(layerLinkPathSpec{
|
||||
name: luc.Name(),
|
||||
name: luc.layerStore.repository.Name(),
|
||||
digest: digest,
|
||||
})
|
||||
|
||||
|
@ -210,7 +205,7 @@ func (luc *layerUploadController) linkLayer(digest digest.Digest) error {
|
|||
// resources are already not present, no error will be returned.
|
||||
func (luc *layerUploadController) removeResources() error {
|
||||
dataPath, err := luc.layerStore.repository.registry.pm.path(uploadDataPathSpec{
|
||||
name: luc.Name(),
|
||||
name: luc.layerStore.repository.Name(),
|
||||
uuid: luc.uuid,
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue