Skip to content

Commit

Permalink
Actually use tags when pushing to dockerImageDestination
Browse files Browse the repository at this point in the history
Now that we update the tags in schema1 manifests, this is safe to do.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Sep 19, 2016
1 parent b8b2ad0 commit 3d64071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions docker/docker_image_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,17 @@ func (d *dockerImageDestination) PutBlob(stream io.Reader, inputInfo types.BlobI
}

func (d *dockerImageDestination) PutManifest(m []byte) error {
// FIXME: This only allows upload by digest, not creating a tag. See the
// corresponding comment in openshift.NewImageDestination.
digest, err := manifest.Digest(m)
if err != nil {
return err
}
d.manifestDigest = digest
url := fmt.Sprintf(manifestURL, d.ref.ref.RemoteName(), digest)

reference, err := d.ref.tagOrDigest()
if err != nil {
return err
}
url := fmt.Sprintf(manifestURL, d.ref.ref.RemoteName(), reference)

headers := map[string][]string{}
mimeType := manifest.GuessMIMEType(m)
Expand Down
2 changes: 0 additions & 2 deletions openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,6 @@ func (d *openshiftImageDestination) PutBlob(stream io.Reader, inputInfo types.Bl

func (d *openshiftImageDestination) PutManifest(m []byte) error {
// FIXME? Can this eventually just call d.docker.PutManifest()?
// Right now we need this as a skeleton to attach signatures to, and
// to workaround our inability to change tags when uploading v2s1 manifests.

// Note: This does absolutely no kind/version checking or conversions.
manifestDigest, err := manifest.Digest(m)
Expand Down

0 comments on commit 3d64071

Please sign in to comment.