-
Notifications
You must be signed in to change notification settings - Fork 788
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
Correctly detect changes in rootdir #1511
Conversation
Can one of the admins verify this patch?
|
bot, add author to whitelist |
Thanks, @danstiner |
Fixes issue where `COPY . <dest>` would never detect changes by using `filepath.Rel()` instead of custom string slicing. Signed-off-by: Daniel Stiner <[email protected]>
Looks like I missed signing off the commit, did that and force pushed. |
The code LGTM, but would like a head nod from @nalind as I'm having problems testing this. I'm running into problems with Podman after I vendor this in, but I think it's self-induced and not related to this PR. |
@danstiner Could you add the tests to make sure we don't regress this. |
Happy to either as part of this PR or as a follow-up. May take a couple days depending how busy I am. |
This approach looks correct to me. Nice catch! |
LGTM |
@rh-atomic-bot r+ |
📌 Commit acee3b3 has been approved by |
☀️ Test successful - status-papr, status-travis |
When using
buildah bud --layers ...
with copy of the root dir (egCOPY . /app
), cached builds will skip the COPY layer even if files have in fact changed.This is because
resolveModifiedTime
bails and says there are notifications if the rootdir is being checked. I don't see any reason we can't check the rootdir except for the custom string slicing to compute relative paths. I replaced that with a call tofilepath.Rel()
and things are working as expected.I believe this may fix containers/podman#2544
I used the following script as a repro that changes the content of a file and re-builds with
--layers
.Expected output shows a cached build picking up the changes to the file:
Actual output as of d43787b: