chainguard-dev / apko

Build OCI images from APK packages directly without Dockerfile

Home Page:https://apko.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misleading error for missing file

amouat opened this issue · comments

If you give the wrong path to an apko.yaml you get a very confusing error e.g:

apko build /wrong/path/apko.yaml test test.tar
ℹ️            | loading config file: /wrong/path/apko.yaml
⚠️            | remote configurations are an experimental feature and subject to change.
Error: failed to load image configuration: unable to fetch remote include from git: failed to clone /wrong/path/apko.yaml: Get "https://wrong/path/info/refs?service=git-upload-pack": dial tcp: lookup wrong: no such host
2024/01/05 14:13:11 error during command execution: failed to load image configuration: unable to fetch remote include from git: failed to clone /wrong/path/apko.yaml: Get "https://wrong/path/info/refs?service=git-upload-pack": dial tcp: lookup wrong: no such host

I would expect something simple like "File not found".

This seems to be caused by a feature that supports remote repos. I think we need to be a little more careful before assuming the user wants a remote repo here:

logger.Warnf("remote configurations are an experimental feature and subject to change.")