Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(multiarch): fix 'werf stage image' command panic related to multi…
…arch refactor

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Mar 22, 2023
1 parent 746a040 commit 9eeb9d4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/werf/run/run.go
Expand Up @@ -410,6 +410,7 @@ func run(ctx context.Context, containerBackend container_backend.ContainerBacken
targetPlatforms = []string{containerBackend.GetDefaultPlatform()}
}

// FIXME(multiarch): specify multiarch manifest here
if err := c.FetchLastImageStage(ctx, targetPlatforms[0], imageName); err != nil {
return err
}
Expand Down
10 changes: 9 additions & 1 deletion cmd/werf/stage/image/main.go
Expand Up @@ -207,8 +207,16 @@ func run(ctx context.Context, imageName string) error {
return err
}

targetPlatforms, err := c.GetTargetPlatforms()
if err != nil {
return fmt.Errorf("invalid target platforms: %w", err)
}
if len(targetPlatforms) == 0 {
targetPlatforms = []string{containerBackend.GetDefaultPlatform()}
}

// FIXME(multiarch): specify multiarch manifest here
fmt.Println(c.GetImageNameForLastImageStage("", imageName))
fmt.Println(c.GetImageNameForLastImageStage(targetPlatforms[0], imageName))

return nil
}); err != nil {
Expand Down

0 comments on commit 9eeb9d4

Please sign in to comment.