Commit Graph

4 Commits

Author SHA1 Message Date
Giuseppe Scrivano d65c99c149
tarlogger: drop state mutex
detect when the read pipe got closed by using the Write error code.

It solves a race, where the pipe could be closed between the check and
the actual write.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-12-07 10:55:07 +01:00
Valentin Rothberg eb03bd9ef4 tarlogger: disable raw accouting
Commit d85da31 enabled raw accounting which is not needed for the
purpose of the tarlogger.  Disable the raw accounting to reduce the
memory footprint considerably (factor of 10 in some cases).

Fixes: #433
Inital-report: github.com/cri-o/cri-o/issues/2847
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-09-25 10:35:43 +02:00
Valentin Rothberg d85da313ef pkg/tarlog: use io.Pipe()
Using `os.Pipe()` has a side effect when writing tar files surfacing in
differing digests (see [1] for reference).  Instead use `io.Pipe()` with
a workaround to avoid writes after the reader has been closed - which is
supported by `os.Pipe()` and causes the tar package to error otherwise.

[1] https://github.com/containers/libpod/pull/3705#issuecomment-517954910

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-08-05 10:37:41 +02:00
Nalin Dahyabhai 0d4a46ce28 Keep track of the UIDs and GIDs used in applied layers
Add a field to the Layer structure that lets us make note of the set of
UIDs and GIDs which own files in the layer, populated by scanning the
diff that we used to populate the layer, if there was one.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-07-16 18:36:54 -04:00