Skip to content

Commit 9eeb9d4

Browse files
committed
fix(multiarch): fix 'werf stage image' command panic related to multiarch refactor
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
1 parent 746a040 commit 9eeb9d4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cmd/werf/run/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
410410
targetPlatforms = []string{containerBackend.GetDefaultPlatform()}
411411
}
412412

413+
// FIXME(multiarch): specify multiarch manifest here
413414
if err := c.FetchLastImageStage(ctx, targetPlatforms[0], imageName); err != nil {
414415
return err
415416
}

cmd/werf/stage/image/main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,16 @@ func run(ctx context.Context, imageName string) error {
207207
return err
208208
}
209209

210+
targetPlatforms, err := c.GetTargetPlatforms()
211+
if err != nil {
212+
return fmt.Errorf("invalid target platforms: %w", err)
213+
}
214+
if len(targetPlatforms) == 0 {
215+
targetPlatforms = []string{containerBackend.GetDefaultPlatform()}
216+
}
217+
210218
// FIXME(multiarch): specify multiarch manifest here
211-
fmt.Println(c.GetImageNameForLastImageStage("", imageName))
219+
fmt.Println(c.GetImageNameForLastImageStage(targetPlatforms[0], imageName))
212220

213221
return nil
214222
}); err != nil {

0 commit comments

Comments
 (0)