mirror of https://github.com/docker/docs.git
Only tag the top-most layer, not all interim layers
This commit is contained in:
parent
7f9cdaa342
commit
d1a631cedb
|
@ -1098,11 +1098,16 @@ func (srv *Server) pushRepository(r *registry.Registry, out io.Writer, localName
|
||||||
for _, ep := range repoData.Endpoints {
|
for _, ep := range repoData.Endpoints {
|
||||||
out.Write(sf.FormatStatus("", "Pushing repository %s (%d tags)", localName, len(localRepo)))
|
out.Write(sf.FormatStatus("", "Pushing repository %s (%d tags)", localName, len(localRepo)))
|
||||||
// This section can not be parallelized (each round depends on the previous one)
|
// This section can not be parallelized (each round depends on the previous one)
|
||||||
for _, round := range imgList {
|
for i, round := range imgList {
|
||||||
// FIXME: This section can be parallelized
|
// FIXME: This section can be parallelized
|
||||||
for _, elem := range round {
|
for _, elem := range round {
|
||||||
var pushTags func() error
|
var pushTags func() error
|
||||||
pushTags = func() error {
|
pushTags = func() error {
|
||||||
|
if i < (len(imgList) - 1) {
|
||||||
|
// Only tag the top layer in the repository
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
out.Write(sf.FormatStatus("", "Pushing tags for rev [%s] on {%s}", elem.ID, ep+"repositories/"+remoteName+"/tags/"+elem.Tag))
|
out.Write(sf.FormatStatus("", "Pushing tags for rev [%s] on {%s}", elem.ID, ep+"repositories/"+remoteName+"/tags/"+elem.Tag))
|
||||||
if err := r.PushRegistryTag(remoteName, elem.ID, elem.Tag, ep, repoData.Tokens); err != nil {
|
if err := r.PushRegistryTag(remoteName, elem.ID, elem.Tag, ep, repoData.Tokens); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue