Skip to content
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

pkg/archive.statDifferent(): care about mtime for directories #1962

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

nalind
Copy link
Member

@nalind nalind commented Jun 7, 2024

When considering changes, don't ignore differences between directories when their mtimes are the only thing we check that's changed. This creates a difference in behavior between the vfs and overlay drivers that shows up in build conformance tests, such as in containers/buildah#5492.

When considering changes, don't ignore differences between directories
when their mtimes are the only thing we check that's changed.  This
creates a difference in behavior between the vfs and overlay drivers
that shows up in build conformance tests.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

openshift-ci bot commented Jun 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, nalind

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Jun 10, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 10, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 75ed3df into containers:main Jun 10, 2024
18 checks passed
@nalind nalind deleted the dir-timestamps-matter branch June 10, 2024 14:58
// Don't look at size for dirs, its not a good measure of change
(oldStat.Mode()&unix.S_IFDIR != unix.S_IFDIR &&
(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) {
(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size())) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is now not making a special case for directories, while the comment still says it does.

Also the sameFsTimeSpec is now AFAICS happening redundantly twice.

A typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I kept the wrong check there. PR incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants