Merge pull request #10291 from ktock/push-platform-conf

Transfer: Push: Enable to specify platforms
This commit is contained in:
Maksym Pavlenko
2024-06-05 21:28:09 +00:00
committed by GitHub
4 changed files with 22 additions and 16 deletions

View File

@@ -112,7 +112,14 @@ var pushCommand = &cli.Command{
if err != nil {
return err
}
is := image.NewStore(local)
var p []ocispec.Platform
if pss := context.StringSlice("platform"); len(pss) > 0 {
p, err = platforms.ParseAll(pss)
if err != nil {
return fmt.Errorf("invalid platform %v: %w", pss, err)
}
}
is := image.NewStore(local, image.WithPlatforms(p...))
pf, done := ProgressHandler(ctx, os.Stdout)
defer done()