Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: return different exit code when an input is not found
This is a proof of concept that shows how we could do a different exit code in skopeo when an input is not found. The use case is `osbuild` which uses skopeo to inspect images and it would be nice to differenciate between an image that is not found and general skopeo errors (or errors like network issues etc). I picked exit code (2) for not found because it is also the value of ENOENT but that is arbitrary and I'm happy to switch to any other value (we could do `44` as `404` :-) - happy about ideas). Man page and a test are added. P.S. I also found that for local images that are not found `ErrNotAnImage` is returned so the docstring of `storage.ErrNotAnImage` may need updating (I'm happy to do this separtely if desired). To reproduce: ``` $ skopeo inspect containers-storage:010101010101 FATA[0000] Error parsing image name "containers-storage:010101010101": reference "[overlay@/media/space/home/egon/.local/share/containers/storage+/run/user/1000/containers]docker.io/library/010101010101:latest" does not resolve to an image ID: identifier is not an image ``` For references (from storage/errors.go): ``` ErrNotAnImage = errors.New("identifier is not an image") ``` Signed-off-by: Michael Vogt <[email protected]>
- Loading branch information