Skip to content

Commit

Permalink
Fix run-image access check in restorer phase (#1386)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
  • Loading branch information
pbusko and nicolasbender authored Jul 29, 2024
1 parent 9f262b3 commit a43d599
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/lifecycle/restorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ func (r *restoreCmd) Exec() error {
}

if r.supportsRunImageExtension() && needsPulling(analyzedMD.RunImage) {
cmd.DefaultLogger.Debugf("Pulling run image metadata for %s...", runImageName)
runImage, err = r.pullSparse(runImageName)
cmd.DefaultLogger.Debugf("Pulling run image metadata for %s...", accessibleRunImage)
runImage, err = r.pullSparse(accessibleRunImage)
if err != nil {
return cmd.FailErr(err, fmt.Sprintf("pull run image %s", runImageName))
return cmd.FailErr(err, fmt.Sprintf("pull run image %s", accessibleRunImage))
}
// update analyzed metadata, even if we only needed to pull the image metadata, because
// the extender needs a digest reference in analyzed.toml,
Expand All @@ -150,9 +150,9 @@ func (r *restoreCmd) Exec() error {
} else if r.needsUpdating(analyzedMD.RunImage, group) {
cmd.DefaultLogger.Debugf("Updating run image info in analyzed metadata...")
h := image.NewHandler(r.docker, r.keychain, r.LayoutDir, r.UseLayout, r.InsecureRegistries)
runImage, err = h.InitImage(runImageName)
runImage, err = h.InitImage(accessibleRunImage)
if err != nil || !runImage.Found() {
return cmd.FailErr(err, fmt.Sprintf("get run image %s", runImageName))
return cmd.FailErr(err, fmt.Sprintf("get run image %s", accessibleRunImage))
}
if err = r.updateAnalyzedMD(&analyzedMD, runImage); err != nil {
return cmd.FailErr(err, "update analyzed metadata")
Expand Down

0 comments on commit a43d599

Please sign in to comment.