Replace platforms.Format with platforms.FormatAll in functional code.

Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
This commit is contained in:
Cesar Talledo
2025-05-14 10:22:36 -07:00
parent cf11cd1aac
commit bb41e5a32e
4 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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