spiegel_podman/pkg
W. Trevor King b2344b83ed pkg/ctime: Factor libpod/finished* into a separate package
This removes some boilerplate from the libpod package, so we can focus
on container stuff there.  And it gives us a tidy sub-package for
focusing on ctime extraction, so we can focus on unit testing and
portability of the extraction utility there.

For the unsupported implementation, I'm falling back to Go's ModTime
[1].  That's obviously not the creation time, but it's likely to be
closer than the uninitialized Time structure from cc6f0e85 (more
changes to compile darwin, 2018-07-04, #1047).  Especially for our use
case in libpod/oci, where we're looking at write-once exit files.

The test is more complicated than I initially expected, because on
Linux filesystem timestamps come from a truncated clock without
interpolation [2] (and network filesystems can be completely decoupled
[3]).  So even for local disks, creation times can be up to a jiffie
earlier than 'before'.  This test ensures at least monotonicity by
creating two files and ensuring the reported creation time for the
second is greater than or equal to the reported creation time for the
first.  It also checks that both creation times are within the window
from one second earlier than 'before' through 'after'.  That should be
enough of a window for local disks, even if the kernel for those
systems has an abnormally large jiffie.  It might be ok on network
filesystems, although it will not be very resilient to network clock
lagging behind the local system clock.

[1]: https://golang.org/pkg/os/#FileInfo
[2]: https://groups.google.com/d/msg/linux.kernel/mdeXx2TBYZA/_4eJEuJoAQAJ
     Subject: Re: Apparent backward time travel in timestamps on file creation
     Date: Thu, 30 Mar 2017 20:20:02 +0200
     Message-ID: <tqMPU-1Sb-21@gated-at.bofh.it>
[3]: https://groups.google.com/d/msg/linux.kernel/mdeXx2TBYZA/cTKj4OBuAQAJ
     Subject: Re: Apparent backward time travel in timestamps on file creation
     Date: Thu, 30 Mar 2017 22:10:01 +0200
     Message-ID: <tqOyl-36A-1@gated-at.bofh.it>

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #1050
Approved by: mheon
2018-07-06 17:54:32 +00:00
..
annotations Spell check strings and comments 2018-05-25 08:45:15 +00:00
chrootuser changes to allow for darwin compilation 2018-06-29 20:44:09 +00:00
ctime pkg/ctime: Factor libpod/finished* into a separate package 2018-07-06 17:54:32 +00:00
hooks hooks: Add debug logging for initial hook loading 2018-06-04 13:01:56 +00:00
inspect add image user to inspect data 2018-07-02 15:10:46 +00:00
kubeutils Remove dependency on kubernetes 2018-03-27 21:55:33 +00:00
registrar Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
registries Spell check strings and comments 2018-05-25 08:45:15 +00:00
rootless rootless: Merge rootless.go back into rootless_linux.go 2018-07-06 00:48:39 +00:00
secrets Want to change the log level on buildah by default to warnf 2018-06-04 15:12:12 +00:00
spec Block use of /proc/acpi from inside containers 2018-07-06 17:29:35 +00:00
util podman: provide a default UID mapping when non root 2018-06-15 14:53:18 +00:00
varlinkapi Add podman container cleanup to CLI 2018-06-29 15:25:21 +00:00