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 building via a Git URL, #5441 added support for directly fetching via the commit (which is notably supported by GitHub). Prior to that, #5072 had added --tags to the git fetch invocations as a partial fix for the same underlying issue (not fetching commits which were part of a tag but not a branch).
However, these two together can now cause issues fetching (in the case of existing cache + updated related tags):
#1 [internal] load git source https://github.com/nginxinc/docker-nginx.git#d21b4f2d90a1abb712a610678872e804267f4815:mainline/alpine-slimfatal: Not a valid object name d21b4f2d90a1abb712a610678872e804267f4815^{commit}From https://github.com/nginxinc/docker-nginx * branch d21b4f2d90a1abb712a610678872e804267f4815 -> FETCH_HEAD ! [rejected] 1.25.5 -> 1.25.5 (would clobber existing tag)
The workaround is simple (clearing the cache and trying again, waiting for the cache to expire naturally, etc), but it would probably be better to update the fetching logic to be something like:
if ref is a commit, try direct fetch-only-by-commit
if ref is not a commit, fetch specified ref directly
worst case, fetch all branches+tags and hope the specified ref comes in
To reproduce the error I found this bug with, yes, I think the upstream tag needs to change. However, since we're doing a build-by-commit, we shouldn't be fetching the tag in the first place (or caring about/updating it during this fetch).
When building via a Git URL, #5441 added support for directly fetching via the commit (which is notably supported by GitHub). Prior to that, #5072 had added
--tags
to thegit fetch
invocations as a partial fix for the same underlying issue (not fetching commits which were part of a tag but not a branch).However, these two together can now cause issues fetching (in the case of existing cache + updated related tags):
The workaround is simple (clearing the cache and trying again, waiting for the cache to expire naturally, etc), but it would probably be better to update the fetching logic to be something like:
(cc @jedevc ❤️)
The text was updated successfully, but these errors were encountered: