-
Notifications
You must be signed in to change notification settings - Fork 243
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
chunked: skip setting time if empty #1996
chunked: skip setting time if empty #1996
Conversation
do not specify the timestamps fields in the TOC if they are empty. Signed-off-by: Giuseppe Scrivano <[email protected]>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, giuseppe 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 |
it improves readability if anyone inspects the TOC file itself and it slightly reduces the TOC size, e.g. with Fedora I get:
so it is just 598 bytes after compression, not really worth mentioning as an improvement :) |
Hum, the Go docs say:
Which is actually different than what I thought (I thought it'd be the unix epoch). So...apparently this actually did come up in practice, but...why?
Which Fedora? quay.io/fedora/fedora:40 ? |
It could be that the tar stream lacks this value and it automatically gets assigned the "zero" value for time.Time
I've built a local image with: FROM registry.fedoraproject.org/fedora:latest
RUN touch /timestamp and squashed it with |
Sorry I know this is a trivial PR and that makes it more likely to be bike-shedded but...this just keeps generating more questions for me. Looking at e.g. the PAX format, mtime is a mandatory field. Presumably it's actually the access time or ctime which are zero? Actually I start to wonder - why the heck did the people creating eStargz add explicit support for atime and ctime? Even mtime is questionable...yes though, it's hard to escape the concept of files having a time (e.g. Python famously depends on it). But nothing should care if we always made atime == ctime == mtime... (xref containers/composefs#163 too here, ctime is simply not representable in composefs). Anyways, |
(As far as atime...well, I agree with a lot of the sentiment behind https://lwn.net/Articles/244829/ ...it should be an opt-in thing for |
And for containers, we're kind of saved by overlayfs:
|
Right, clicking on the composefs link, we already covered this topic earlier in #1646 (comment) So omitting the times here makes sense. |
do not specify the timestamps fields in the TOC if they are empty.