mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Replace platforms.Format with platforms.FormatAll in functional code.
Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
This commit is contained in:
@@ -182,7 +182,7 @@ func (is *Source) resolveRemote(ctx context.Context, ref string, platform *ocisp
|
||||
p = *platform
|
||||
}
|
||||
// key is used to synchronize resolutions that can happen in parallel when doing multi-stage.
|
||||
key := "getconfig::" + ref + "::" + platforms.Format(p)
|
||||
key := "getconfig::" + ref + "::" + platforms.FormatAll(p)
|
||||
res, err := is.g.Do(ctx, key, func(ctx context.Context) (*resolveRemoteResult, error) {
|
||||
res := resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g)
|
||||
dgst, dt, err := imageutil.Config(ctx, ref, res, is.ContentStore, is.LeaseManager, platform)
|
||||
|
||||
@@ -79,7 +79,7 @@ func (i *ImageService) PullImage(ctx context.Context, baseRef reference.Named, p
|
||||
func (i *ImageService) pullTag(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registrytypes.AuthConfig, out progress.Output) error {
|
||||
var opts []containerd.RemoteOpt
|
||||
if platform != nil {
|
||||
opts = append(opts, containerd.WithPlatform(platforms.Format(*platform)))
|
||||
opts = append(opts, containerd.WithPlatform(platforms.FormatAll(*platform)))
|
||||
}
|
||||
|
||||
resolver, _ := i.newResolverFromAuthConfig(ctx, authConfig, ref)
|
||||
|
||||
@@ -16,7 +16,7 @@ func MultiPlatform(dir string, imageRef string, imagePlatforms []ocispec.Platfor
|
||||
var descs []ocispec.Descriptor
|
||||
|
||||
for _, platform := range imagePlatforms {
|
||||
ps := platforms.Format(platform)
|
||||
ps := platforms.FormatAll(platform)
|
||||
manifestDesc, _, err := oneLayerPlatformManifest(dir, platform, FileInLayer{Path: "bash", Content: []byte("layer-" + ps)})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
@@ -26,7 +26,7 @@ func PartialMultiPlatform(dir string, imageRef string, opts PartialOpts) (*ocisp
|
||||
var descs []ocispec.Descriptor
|
||||
|
||||
for _, platform := range opts.Stored {
|
||||
ps := platforms.Format(platform)
|
||||
ps := platforms.FormatAll(platform)
|
||||
manifestDesc, _, err := oneLayerPlatformManifest(dir, platform, FileInLayer{Path: "bash", Content: []byte("layer-" + ps)})
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
Reference in New Issue
Block a user