Skip to content

Commit

Permalink
Read rebase from io.buildpacks.lifecycle.metdata runImage
Browse files Browse the repository at this point in the history
For Platforms >= 0.12, the default rebase target has moved to the `runImage` key in the `io.buildpacks.lifecycle.metadata` label. This change allows the lifecycle to read the `runImage` key and use it as the default rebase target.

Signed-off-by: Jesse Brown <jabrown85@gmail.com>
  • Loading branch information
jabrown85 committed Mar 9, 2023
1 parent bfd3344 commit aa42fa0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/lifecycle/rebaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ func (r *rebaseCmd) setAppImage() error {
}

if r.RunImageRef == "" {
if r.PlatformAPI.AtLeast("0.12") {
if md.RunImage.Reference == "" {
return cmd.FailErrCode(errors.New("-run-image is required when there is no run image metadata available"), cmd.CodeForInvalidArgs, "parse arguments")
}
r.RunImageRef = md.RunImage.Reference
return nil
}
if md.Stack.RunImage.Image == "" {
return cmd.FailErrCode(errors.New("-run-image is required when there is no stack metadata available"), cmd.CodeForInvalidArgs, "parse arguments")
}
Expand Down

0 comments on commit aa42fa0

Please sign in to comment.