|
@@ -27,11 +27,6 @@ type v2Pusher struct {
|
|
config *ImagePushConfig
|
|
config *ImagePushConfig
|
|
sf *streamformatter.StreamFormatter
|
|
sf *streamformatter.StreamFormatter
|
|
repo distribution.Repository
|
|
repo distribution.Repository
|
|
-
|
|
|
|
- // layersSeen is the set of layers known to exist on the remote side.
|
|
|
|
- // This avoids redundant queries when pushing multiple tags that
|
|
|
|
- // involve the same layers.
|
|
|
|
- layersSeen map[string]bool
|
|
|
|
}
|
|
}
|
|
|
|
|
|
func (p *v2Pusher) Push() (fallback bool, err error) {
|
|
func (p *v2Pusher) Push() (fallback bool, err error) {
|
|
@@ -92,6 +87,8 @@ func (p *v2Pusher) pushV2Tag(tag string) error {
|
|
return fmt.Errorf("tag does not exist: %s", tag)
|
|
return fmt.Errorf("tag does not exist: %s", tag)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ layersSeen := make(map[string]bool)
|
|
|
|
+
|
|
layer, err := p.graph.Get(layerID)
|
|
layer, err := p.graph.Get(layerID)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
@@ -120,7 +117,7 @@ func (p *v2Pusher) pushV2Tag(tag string) error {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- if p.layersSeen[layer.ID] {
|
|
|
|
|
|
+ if layersSeen[layer.ID] {
|
|
break
|
|
break
|
|
}
|
|
}
|
|
|
|
|
|
@@ -175,7 +172,7 @@ func (p *v2Pusher) pushV2Tag(tag string) error {
|
|
m.FSLayers = append(m.FSLayers, manifest.FSLayer{BlobSum: dgst})
|
|
m.FSLayers = append(m.FSLayers, manifest.FSLayer{BlobSum: dgst})
|
|
m.History = append(m.History, manifest.History{V1Compatibility: string(jsonData)})
|
|
m.History = append(m.History, manifest.History{V1Compatibility: string(jsonData)})
|
|
|
|
|
|
- p.layersSeen[layer.ID] = true
|
|
|
|
|
|
+ layersSeen[layer.ID] = true
|
|
}
|
|
}
|
|
|
|
|
|
logrus.Infof("Signed manifest for %s:%s using daemon's key: %s", p.repo.Name(), tag, p.trustKey.KeyID())
|
|
logrus.Infof("Signed manifest for %s:%s using daemon's key: %s", p.repo.Name(), tag, p.trustKey.KeyID())
|