-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ref spec for default Git context #347
Conversation
@crazy-max Thank you for the implementation! For the
A I suppose @crazy-max designed so because So, I think this patch implements the current best possible approach. |
Yes indeed it's not possible atm to specify the commit because the current parser does not support it. Git URLs accept the context configuration in their fragment section, separated by a colon (
Same applies for classic |
@crazy-max is this a bug in how buildkit gets the reference? looking at the
So it is possible to specify a commit, but I guess in this case the commit is not in the main repository? Otherwise |
Not a bug actually but I think the parser could be enhanced to allow more complex refspec. Could be useful in our case to be able to check out |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
I think that is not a bug or a lack of feature in the context URL parser, but a corner case in how the builder checks out the given reference Here is a pull request with two commits pushed on top of the master branch: hanazuki/build-push-action-test2#1. The commits in my previous diagram correspond to these SHA1's in this case:
For B+Y, both of the following commands succeed:
But for A+Y,
|
Just noticed that plain (non-buildkit)
|
For record, my testing environment is a Debian sid box with the following pieces of software:
|
Yes that's right, good point!
Just tested myself and it works for me too. |
This might be linked to this code in buildkit. WDYT @tonistiigi? |
Fixes #336
cc. @hanazuki
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com