Browse code

distribution: Remove misleading comment

Remove the following comment in pullV2Tag:

// NOTE: not using TagService.Get, since it uses HEAD requests
// against the manifests endpoint, which are not supported by
// all registry versions.

This is actually not an issue, because TagService.Get does a fallback to
GET if HEAD fails. It has done this ever since TagService was added to
the distribution API, so this comment was probably based on an early
version of TagService before it was merged, or was always a
misunderstanding.

However, we continue to use ManifestService.Get instead because it
saves a round trip. The manifest can be retrieved directly instead of
resolving the digest first.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>

Aaron Lehmann authored on 2016/11/05 09:10:47
Showing 1 changed files
... ...
@@ -338,9 +338,6 @@ func (p *v2Puller) pullV2Tag(ctx context.Context, ref reference.Named) (tagUpdat
338 338
 		tagOrDigest string // Used for logging/progress only
339 339
 	)
340 340
 	if tagged, isTagged := ref.(reference.NamedTagged); isTagged {
341
-		// NOTE: not using TagService.Get, since it uses HEAD requests
342
-		// against the manifests endpoint, which are not supported by
343
-		// all registry versions.
344 341
 		manifest, err = manSvc.Get(ctx, "", distribution.WithTag(tagged.Tag()))
345 342
 		if err != nil {
346 343
 			return false, allowV1Fallback(err)