mirror of https://github.com/containers/image.git
Remove storageReference.name
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
059c0fc4d7
commit
841cbfeabd
|
|
@ -249,7 +249,6 @@ func newImageDestination(imageRef storageReference) (*storageImageDestination, e
|
|||
// reference that mentions the no-longer-correct digest.
|
||||
publicRef := imageRef
|
||||
publicRef.breakDockerReference = true // FIXME: this does not change .StringWithinTransport(), but modifies DockerReference()
|
||||
publicRef.name = nil
|
||||
image := &storageImageDestination{
|
||||
imageRef: imageRef,
|
||||
publicRef: publicRef,
|
||||
|
|
|
|||
|
|
@ -21,11 +21,10 @@ type storageReference struct {
|
|||
completeReference reference.Named // may include a tag and/or a digest
|
||||
reference string
|
||||
id string
|
||||
name reference.Named // May include a tag, not a digest
|
||||
breakDockerReference bool // Possibly set by newImageDestination. FIXME: Figure out another way.
|
||||
}
|
||||
|
||||
func newReference(transport storageTransport, completeReference reference.Named, reference, id string, name reference.Named) *storageReference {
|
||||
func newReference(transport storageTransport, completeReference reference.Named, reference, id string) *storageReference {
|
||||
// We take a copy of the transport, which contains a pointer to the
|
||||
// store that it used for resolving this reference, so that the
|
||||
// transport that we'll return from Transport() won't be affected by
|
||||
|
|
@ -35,7 +34,6 @@ func newReference(transport storageTransport, completeReference reference.Named,
|
|||
completeReference: completeReference,
|
||||
reference: reference,
|
||||
id: id,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,14 +136,14 @@ func TestParse(t *testing.T) {
|
|||
}
|
||||
_references := []storageReference{
|
||||
{
|
||||
name: ref.(*storageReference).name,
|
||||
reference: ref.(*storageReference).name.String(),
|
||||
completeReference: ref.(*storageReference).completeReference,
|
||||
reference: ref.(*storageReference).completeReference.String(),
|
||||
id: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
||||
transport: transport,
|
||||
},
|
||||
{
|
||||
name: ref.(*storageReference).name,
|
||||
reference: ref.(*storageReference).name.String(),
|
||||
completeReference: ref.(*storageReference).completeReference,
|
||||
reference: ref.(*storageReference).completeReference.String(),
|
||||
transport: transport,
|
||||
},
|
||||
{
|
||||
|
|
@ -151,7 +151,7 @@ func TestParse(t *testing.T) {
|
|||
transport: transport,
|
||||
},
|
||||
{
|
||||
name: ref.DockerReference(),
|
||||
completeReference: ref.DockerReference(),
|
||||
reference: ref.DockerReference().String(),
|
||||
transport: transport,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ func (s storageTransport) ParseStoreReference(store storage.Store, ref string) (
|
|||
} else {
|
||||
logrus.Debugf("parsed reference to refname@id into %q", storeSpec+refname+"@"+id)
|
||||
}
|
||||
return newReference(storageTransport{store: store, defaultUIDMap: s.defaultUIDMap, defaultGIDMap: s.defaultGIDMap}, completeReference, refname, id, name), nil
|
||||
return newReference(storageTransport{store: store, defaultUIDMap: s.defaultUIDMap, defaultGIDMap: s.defaultGIDMap}, completeReference, refname, id), nil
|
||||
}
|
||||
|
||||
func (s *storageTransport) GetStore() (storage.Store, error) {
|
||||
|
|
|
|||
|
|
@ -74,11 +74,11 @@ func TestTransportParseStoreReference(t *testing.T) {
|
|||
assert.Equal(t, c.expectedRef, storageRef.reference, c.input)
|
||||
assert.Equal(t, c.expectedID, storageRef.id, c.input)
|
||||
if c.expectedRef == "" {
|
||||
assert.Nil(t, storageRef.name, c.input)
|
||||
assert.Nil(t, storageRef.completeReference, c.input)
|
||||
} else {
|
||||
dockerRef, err := reference.ParseNormalizedNamed(c.expectedRef)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, storageRef.name, c.input)
|
||||
require.NotNil(t, storageRef.completeReference, c.input)
|
||||
assert.Equal(t, dockerRef.String(), storageRef.reference)
|
||||
assert.Equal(t, dockerRef.String(), storageRef.DockerReference().String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue