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

@@ -33,22 +33,12 @@ import (
)
func (ts *localTransferService) push(ctx context.Context, ig transfer.ImageGetter, p transfer.ImagePusher, tops *transfer.Config) error {
/*
// TODO: Platform matching
if pushCtx.PlatformMatcher == nil {
if len(pushCtx.Platforms) > 0 {
ps, err := platforms.ParseAll(pushCtx.Platforms)
if err != nil {
return err
}
pushCtx.PlatformMatcher = platforms.Any(ps...)
} else {
pushCtx.PlatformMatcher = platforms.All
}
}
*/
matcher := platforms.All
// Filter push
if ipg, ok := ig.(transfer.ImagePlatformsGetter); ok {
if ps := ipg.Platforms(); len(ps) > 0 {
matcher = platforms.Any(ps...)
}
}
img, err := ig.Get(ctx, ts.images)
if err != nil {