Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions cmd/lifecycle/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,15 @@ func (e *exportCmd) initLayoutAppImage(analyzedMD files.Analyzed) (imgutil.Image
return nil, "", cmd.FailErr(err, "parsing run image reference")
}

// Load run image first - this WILL error if it fails
runImage, err := layout.NewImage(runImageIdentifier.Path)
if err != nil {
return nil, "", cmd.FailErr(err, "access run image")
}

// Build options with the successfully loaded image as base
var opts = []imgutil.ImageOption{
layout.FromBaseImagePath(runImageIdentifier.Path),
layout.FromBaseImageInstance(runImage.UnderlyingImage()),
}

if e.supportsHistory() {
Expand Down Expand Up @@ -425,10 +432,6 @@ func (e *exportCmd) initLayoutAppImage(analyzedMD files.Analyzed) (imgutil.Image
return nil, "", err
}

runImage, err := layout.NewImage(runImageIdentifier.Path)
if err != nil {
return nil, "", cmd.FailErr(err, "access run image")
}
runImageID, err := runImage.Identifier()
if err != nil {
return nil, "", cmd.FailErr(err, "get run image reference")
Expand Down
Loading