You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running exporter during a daemon mode build, if the target run image is not in the daemon, exporter fails with the following error...
ERROR: failed to export: get run image top layer SHA: image has no layers
The error should instead indicate the run image was not found..
Reproduction
Run a daemon build using a platform, and arrange for the target run image to be absent from the daemon before exporter is executed.
Current behavior
Discovered during platform development, while debugging multi-arch issues.
Can occur when the platform has pulled the run image by it's name, but restorer has altered the run reference to be for the architecture specific sha reference. The platform pulled image will have the sha of the combined manifest, not the architecture specific one, leading to exporter being unable to locate the run image in the daemon. Although this particular example is likely unique to Platform versions 0.10 and 0.11 (because at 0.12 onwards restorer gained a -daemon flag and uses daemon image id's rather than architecture specific sha hashes), the problem is not uniquely constrained to this scenario and will occur whenever the run image is missing during export.
The error ERROR: failed to export: get run image top layer SHA: image has no layers is misleading, and a better error should be output.
Expected behavior
Expected an error indicating the targetted run image was not found during export. The error should ideally output the run image reference that had the issue, to enable end users to debug why the error occurred.
Context
lifecycle version
Tested against main at commit 9a7a3b5 , the error comes down to cmd/lifecycle/exporter.go within the initDaemonAppImage method, after calling imgutil's local.NewImage, the result is tested to see if the appImage Identifier can be retrieved. If not, the code should terminate there.
In the case of the missing image, on docker, it would appear appImage.Identifier() returns an empty string, so the code proceeds assuming it has created the new run image, when no image has been created. This eventually leads to the reported error when the code attempts to retrieve the top layer sha from the new image.
Should trap when run image ID is an empty string, and exit with an error saying the run image was absent.
The text was updated successfully, but these errors were encountered:
Summary
When running exporter during a daemon mode build, if the target run image is not in the daemon, exporter fails with the following error...
The error should instead indicate the run image was not found..
Reproduction
Run a daemon build using a platform, and arrange for the target run image to be absent from the daemon before exporter is executed.
Current behavior
Discovered during platform development, while debugging multi-arch issues.
Can occur when the platform has pulled the run image by it's name, but restorer has altered the run reference to be for the architecture specific sha reference. The platform pulled image will have the sha of the combined manifest, not the architecture specific one, leading to exporter being unable to locate the run image in the daemon. Although this particular example is likely unique to Platform versions 0.10 and 0.11 (because at 0.12 onwards restorer gained a -daemon flag and uses daemon image id's rather than architecture specific sha hashes), the problem is not uniquely constrained to this scenario and will occur whenever the run image is missing during export.
The error
ERROR: failed to export: get run image top layer SHA: image has no layers
is misleading, and a better error should be output.Expected behavior
Expected an error indicating the targetted run image was not found during export. The error should ideally output the run image reference that had the issue, to enable end users to debug why the error occurred.
Context
lifecycle version
Tested against main at commit 9a7a3b5 , the error comes down to
cmd/lifecycle/exporter.go
within theinitDaemonAppImage
method, after calling imgutil's local.NewImage, the result is tested to see if the appImage Identifier can be retrieved. If not, the code should terminate there.In the case of the missing image, on docker, it would appear
appImage.Identifier()
returns an empty string, so the code proceeds assuming it has created the new run image, when no image has been created. This eventually leads to the reported error when the code attempts to retrieve the top layer sha from the new image.Should trap when run image ID is an empty string, and exit with an error saying the run image was absent.
The text was updated successfully, but these errors were encountered: