Skip to content

Fail the exporter with a clear error when the run image is missing from the daemon - #1760

Merged
jabrown85 merged 1 commit into
buildpacks:mainfrom
yuminn-k:lifecycle-1456-fix
Nov 16, 2026
Merged

jabrown85 merged 1 commit into
buildpacks:mainfrom
yuminn-k:lifecycle-1456-fix

Conversation

@yuminn-k

Copy link
Copy Markdown
Contributor

Summary

In daemon mode, exporter now fails with run image "<ref>" not found in daemon when the run image is not in the daemon. Before, it failed later with the misleading get run image top layer SHA: image has no layers.

local.NewImage leaves the base image unset when the daemon returns NotFound for the run image. Identifier() then returns an empty ID and a nil error, so the check in initDaemonAppImage passed and the export continued with an empty image. initDaemonAppImage now checks appImage.Found() right after local.NewImage, the same way rebaser and restorer do.

I did not use the read-access check that was suggested in the issue (like the analyze phase). In daemon mode AccessChecker() in platform/lifecycle_inputs.go is a no-op, so it would not catch a missing image.

Test: a unit test in cmd/lifecycle uses a fake docker client whose daemon has no images. It fails on main (Expected an error but got nil) and passes with this change. I did not add an acceptance test, since those need Docker and run in CI.

Release notes

When the run image is missing from the daemon, exporter now fails with an error naming the run image instead of image has no layers.


Related

Resolves #1456


Context

Verified locally: go test for all non-acceptance packages passes, and golangci-lint run --new-from-rev=origin/main reports 0 issues. Acceptance tests were not run.

…om the daemon

Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
@yuminn-k
yuminn-k requested a review from a team as a code owner November 16, 2026 06:02
@jabrown85
jabrown85 merged commit 0df7976 into buildpacks:main Nov 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect Error during Exporter "ERROR: failed to export: get run image top layer SHA: image has no layers"

2 participants