Skip to content

Commit 7a57e73

Browse files
committed
Replace platforms.Format with platforms.FormatAll in functional code.
Signed-off-by: Cesar Talledo <[email protected]>
1 parent 78aec4f commit 7a57e73

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

builder/builder-next/adapters/containerimage/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (is *Source) resolveRemote(ctx context.Context, ref string, platform *ocisp
182182
p = *platform
183183
}
184184
// key is used to synchronize resolutions that can happen in parallel when doing multi-stage.
185-
key := "getconfig::" + ref + "::" + platforms.Format(p)
185+
key := "getconfig::" + ref + "::" + platforms.FormatAll(p)
186186
res, err := is.g.Do(ctx, key, func(ctx context.Context) (*resolveRemoteResult, error) {
187187
res := resolver.DefaultPool.GetResolver(is.RegistryHosts, ref, "pull", sm, g)
188188
dgst, dt, err := imageutil.Config(ctx, ref, res, is.ContentStore, is.LeaseManager, platform)

builder/builder-next/worker/worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ func (w *Worker) Platforms(noCache bool) []ocispec.Platform {
160160
if noCache {
161161
pm := make(map[string]struct{}, len(w.Opt.Platforms))
162162
for _, p := range w.Opt.Platforms {
163-
pm[platforms.Format(p)] = struct{}{}
163+
pm[platforms.FormatAll(p)] = struct{}{}
164164
}
165165
for _, p := range archutil.SupportedPlatforms(noCache) {
166-
if _, ok := pm[platforms.Format(p)]; !ok {
166+
if _, ok := pm[platforms.FormatAll(p)]; !ok {
167167
w.Opt.Platforms = append(w.Opt.Platforms, p)
168168
}
169169
}

daemon/containerd/image_pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (i *ImageService) PullImage(ctx context.Context, baseRef reference.Named, p
7979
func (i *ImageService) pullTag(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registrytypes.AuthConfig, out progress.Output) error {
8080
var opts []containerd.RemoteOpt
8181
if platform != nil {
82-
opts = append(opts, containerd.WithPlatform(platforms.Format(*platform)))
82+
opts = append(opts, containerd.WithPlatform(platforms.FormatAll(*platform)))
8383
}
8484

8585
resolver, _ := i.newResolverFromAuthConfig(ctx, authConfig, ref)

internal/testutils/specialimage/multiplatform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func MultiPlatform(dir string, imageRef string, imagePlatforms []ocispec.Platfor
1616
var descs []ocispec.Descriptor
1717

1818
for _, platform := range imagePlatforms {
19-
ps := platforms.Format(platform)
19+
ps := platforms.FormatAll(platform)
2020
manifestDesc, _, err := oneLayerPlatformManifest(dir, platform, FileInLayer{Path: "bash", Content: []byte("layer-" + ps)})
2121
if err != nil {
2222
return nil, nil, err

internal/testutils/specialimage/partial.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func PartialMultiPlatform(dir string, imageRef string, opts PartialOpts) (*ocisp
2626
var descs []ocispec.Descriptor
2727

2828
for _, platform := range opts.Stored {
29-
ps := platforms.Format(platform)
29+
ps := platforms.FormatAll(platform)
3030
manifestDesc, _, err := oneLayerPlatformManifest(dir, platform, FileInLayer{Path: "bash", Content: []byte("layer-" + ps)})
3131
if err != nil {
3232
return nil, nil, err

0 commit comments

Comments
 (0)