podman/libpod
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
..
common Change un/pwd handling to match Buildah's 2018-02-06 09:29:23 -05:00
driver Migrate Create|Commit to ginkgo 2018-02-02 22:44:40 +00:00
image remove buildah requirement for the libpod image library 2018-07-06 17:03:19 +00:00
layers Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
testdata Add hooks support to podman 2018-04-05 14:13:49 +00:00
boltdb_state.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
boltdb_state_internal.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
boltdb_state_linux.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
boltdb_state_unsupported.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
common_test.go *: Replace Generator.Spec() with Generator.Config 2018-06-27 21:27:19 +00:00
container.go Remove per-container CGroup parents 2018-07-06 15:29:38 +00:00
container_api.go Make CGroups cleanup optional on whether they exist 2018-06-22 19:26:46 +00:00
container_attach.go libpod: fix race with attach/start 2018-06-20 09:36:04 +02:00
container_commit.go podman: accept option --rootfs to use exploded images 2018-06-15 14:53:18 +00:00
container_graph.go Remove a loop in container graph 2018-03-29 02:18:45 +00:00
container_graph_test.go Fix tests 2018-03-29 02:18:45 +00:00
container_inspect.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
container_internal.go Remove per-container CGroup parents 2018-07-06 15:29:38 +00:00
container_internal_linux.go Remove per-container CGroup parents 2018-07-06 15:29:38 +00:00
container_internal_test.go libpod: Execute poststop hooks locally 2018-06-04 18:36:40 +00:00
container_internal_unsupported.go Remove now-unneeded cleanupCgroup() for unsupported OS 2018-07-06 15:29:38 +00:00
container_linux.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
container_top.go top: make output tabular 2018-06-18 12:56:44 +00:00
container_unsupported.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
diff.go Stage 4 Image cleanup 2018-03-23 15:35:37 +00:00
errors.go changes to allow for darwin compilation 2018-06-29 20:44:09 +00:00
in_memory_state.go Add pod state 2018-05-17 23:10:12 +00:00
info.go Spell check strings and comments 2018-05-25 08:45:15 +00:00
networking_linux.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
networking_unsupported.go libpod/networking_unsupported: Remove JoinNetworkNameSpace 2018-07-06 00:48:39 +00:00
oci.go pkg/ctime: Factor libpod/finished* into a separate package 2018-07-06 17:54:32 +00:00
oci_linux.go Remove per-container CGroup parents 2018-07-06 15:29:38 +00:00
oci_unsupported.go more changes to compile darwin 2018-07-05 16:05:12 +00:00
options.go Add podman container cleanup to CLI 2018-06-29 15:25:21 +00:00
pod.go Make CGroups cleanup optional on whether they exist 2018-06-22 19:26:46 +00:00
runtime.go rootless: add /run/user/$UID to the lookup paths 2018-07-05 13:30:15 +00:00
runtime_ctr.go Returning joining namespace error should not be fatal 2018-06-29 14:32:57 +00:00
runtime_img.go libpod: Execute poststop hooks locally 2018-06-04 18:36:40 +00:00
runtime_img_test.go regression: tls verify should be set on registries.conf if insecure 2018-04-18 14:07:59 +00:00
runtime_pod.go libpod/runtime_pod: Make removePod per-platform 2018-07-06 00:48:39 +00:00
runtime_pod_linux.go libpod/runtime_pod: Make removePod per-platform 2018-07-06 00:48:39 +00:00
runtime_pod_unsupported.go libpod/runtime_pod: Make removePod per-platform 2018-07-06 00:48:39 +00:00
state.go Spell check strings and comments 2018-05-25 08:45:15 +00:00
state_test.go Add pod state 2018-05-17 23:10:12 +00:00
stats.go changes to allow for darwin compilation 2018-06-29 20:44:09 +00:00
stats_config.go changes to allow for darwin compilation 2018-06-29 20:44:09 +00:00
stats_unsupported.go changes to allow for darwin compilation 2018-06-29 20:44:09 +00:00
storage.go We are using err in defer function, needs to be defined name 2018-06-22 13:43:19 +00:00
util.go Stage 4 Image cleanup 2018-03-23 15:35:37 +00:00
util_test.go Stage3 Image Library 2018-03-14 20:21:31 +00:00
version.go varlink images 2018-04-26 19:14:44 +00:00