Skip to content

Conversation

nalind
Copy link
Member

@nalind nalind commented Feb 4, 2025

Unixy systems have Lutimes(), and we should have stubbed it out for non-Unixy systems.

Copy link
Contributor

openshift-ci bot commented Feb 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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

@openshift-ci openshift-ci bot added the approved label Feb 4, 2025
@nalind nalind force-pushed the archive-test-windows branch from 77768b6 to 0427b27 Compare February 4, 2025 15:44
@nalind nalind mentioned this pull request Feb 4, 2025
@nalind nalind force-pushed the archive-test-windows branch 3 times, most recently from 17b2f22 to d59ef59 Compare February 4, 2025 18:09
@rhatdan
Copy link
Member

rhatdan commented Feb 4, 2025

LGTM

@nalind nalind force-pushed the archive-test-windows branch from d59ef59 to 4af591e Compare February 4, 2025 18:28
Comment on lines 1 to 2
//go:build !windows

Copy link
Contributor

Choose a reason for hiding this comment

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

Strictly speaking,

  1. it should be unix rather than !windows (otherwise it won't work on e.g. plan9).
  2. the build tag is redundant as we have _unix_test.go in the file name (supported since Go 1.19)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll have to remember that. Thanks!

"golang.org/x/sys/unix"
)

// resetSymlinkTimesLinux sets the atime and mtime of a symlink to a known value, to test
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// resetSymlinkTimesLinux sets the atime and mtime of a symlink to a known value, to test
// resetSymlinkTimes sets the atime and mtime of a symlink to a known value, to test

Copy link
Member Author

Choose a reason for hiding this comment

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

Oof, shoulda caught that. Thanks!

// resetSymlinkTimesLinux sets the atime and mtime of a symlink to a known value, to test
// whether changes to the symlink target are detected correctly.
func resetSymlinkTimesLinux(path string) error {
if runtime.GOOS != linux {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: with that, const linux in archive.go (introduced by commit f5c1ad9) is now unused.

Unixy systems all have Lutimes(), and this code should have been stubbed
out for non-Unixy systems.

h/t @kolyshkin

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@nalind nalind force-pushed the archive-test-windows branch from 4af591e to cd5ef3f Compare February 4, 2025 21:08
@rhatdan
Copy link
Member

rhatdan commented Feb 4, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Feb 4, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 5a2ca6a into containers:main Feb 4, 2025
20 checks passed
@nalind nalind deleted the archive-test-windows branch February 4, 2025 22:37
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.

3 participants