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
Every container image built by lkt pkg build adds a few standard tags in the config, including git commit, etc.
One of those tags is org.opencontainers.image.source. lkt pkg build uses the following logic:
If the source is provided in build.yaml, use that
If not, fall back to https://github.com/linuxkit/linuxkit
Given how much lkt pkg build determines from the git dir (tree hash, commit, tag if any, etc.), it should be able to determine the source as well as the commit, and not just fall back to https://github.com/linuxkit/linuxkit every time.
The problem is, how do you determine it? git remote doesn't quite give it to you, as it includes not just the canonical URL, but the access mode. Should it be git+ssh? Or maybe git@github.com:foo/bar.git? Or the (more canonical) https://github.com/foo/bar? Or https://github.com/foo/bar.git? How would we determine it? Rules for github conversions may not be the same as for gitlab as for some private git repo as for Atlassian bitbucket as, etc.
Further, people can use their own aliases for the hostname to change logins for various repos, so git@user.github.com:foo/bar might actually be the exact same repo as git@github.com:foo/bar, which is https://github.com/foo/bar.
How would we resolve it?
I am looking for sane approaches that don't cause too much surprise. My current leanings are towards:
If it is in build.yaml, take it as is (current override)
If not, read the remotes, select the right remote:
Only one remote? Use that; else
Two or more repos and one is upstream? Use that; else
Two or more repos and one is origin? Use that; else
Default to current linuxkit one
As for interpreting the URL:
http URL? use it as is
git URL?
If the hostname ends in github.com, canonicalize it to https
If it does not, fall back to default
I know this doesn't cover everything, but seems reasonable to start. It should be a reasonable improvement.
The text was updated successfully, but these errors were encountered:
Yes it is. The logic for getting the hash works correctly. The logic for getting the repo canonical address is much more limited for the reasons listed above.
Description
Every container image built by
lkt pkg build
adds a few standard tags in the config, including git commit, etc.One of those tags is
org.opencontainers.image.source
.lkt pkg build
uses the following logic:build.yaml
, use thathttps://github.com/linuxkit/linuxkit
Given how much
lkt pkg build
determines from the git dir (tree hash, commit, tag if any, etc.), it should be able to determine the source as well as the commit, and not just fall back tohttps://github.com/linuxkit/linuxkit
every time.The problem is, how do you determine it?
git remote
doesn't quite give it to you, as it includes not just the canonical URL, but the access mode. Should it begit+ssh
? Or maybegit@github.com:foo/bar.git
? Or the (more canonical)https://github.com/foo/bar
? Orhttps://github.com/foo/bar.git
? How would we determine it? Rules forgithub
conversions may not be the same as for gitlab as for some private git repo as for Atlassian bitbucket as, etc.Further, people can use their own aliases for the hostname to change logins for various repos, so
git@user.github.com:foo/bar
might actually be the exact same repo asgit@github.com:foo/bar
, which ishttps://github.com/foo/bar
.How would we resolve it?
I am looking for sane approaches that don't cause too much surprise. My current leanings are towards:
build.yaml
, take it as is (current override)upstream
? Use that; elseorigin
? Use that; elseAs for interpreting the URL:
http
URL? use it as isgit
URL?I know this doesn't cover everything, but seems reasonable to start. It should be a reasonable improvement.
The text was updated successfully, but these errors were encountered: