-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Image timestamps are incorrect #891
Comments
For example:
But since it is the same as an earlier build (I reverted some changes that I made), it looks older to Flux. |
Your diagnosis is correct: older flux (<v1.2), and in some circumstances newer flux, uses the timestamp of the topmost image layer as the image creation date. The reason is that the backward-compatible ( (*More accurately: schema2 manifests include a digest which doubles as a pointer to a file which has the metadata.) I'm surprised that you have this problem with |
While I'm here, some oblique ways to fix this kind of thing would be:
|
I'm running |
It looks like the image is stored locally in a way that loses the identity of the exact tag:
I suspect if I were building this in a regular CI environment where the old tags aren't around, then I would have avoided running into this. |
OK right -- my hypothesis was that an old version of Docker somewhere was pushing schema1 manifests, so that's what flux was getting, and that's why it could only use the image layer created date. But the first bit isn't true -- Docker v17 will be pushing schema2 manifests. I was pretty sure that GCR served schema2 manifests (see #780) if that's what you push to it. Surprising. I did write a tool for getting more information about manifests, at one point, let me see if I can find it .. |
New hypothesis: the data we extract from the schema2 manifests is still not what you expected. Is |
Actually I can answer that for myself by looking at what you wrote above .. Can you get a more precise time stamp from the GCR UI, and is it |
It looks like flux and the GCR UI don't agree on the timestamp:
And in the GCR UI:
I believe the Flux timestamps are the earliest build of that image that I made, and the GCR timestamp is the latest. |
Looks like that to me too. So, now to figure out where GCR is getting its timestamp from ... |
Workaround for now, that may or may not be to your taste: make a minor change in the image build (e.g., by including a label of the git revision in the Dockerfile) and push it again. |
The essential problem is that the registry API (of any version to date) doesn't expose information about tags -- that's left to Docker, if you build locally, and to the implementation of the image registry. In |
This adds support for overwriting the image created at timestamp with labels which are set during build. Supported labels (for now) are the Open Container Image (OCI) spec[1] and the (legacy) Label Schema (LS) spec[2]. We prioritize OCI over LS, with a fallback to the CreatedAt. This should serve a wide range of users who either have internal rules for image builds (e.g. timestamp set to null as reported in #1797) or want a stable reliable pointer they can have control over (#746, #891). [1]: https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys [2]: http://label-schema.org/rc1/#build-time-labels
This adds support for overwriting the image created at timestamp with labels which are set during build. Supported labels (for now) are the Open Container Image (OCI) spec[1] and the (legacy) Label Schema (LS) spec[2]. We prioritize OCI over LS, with a fallback to the CreatedAt. This should serve a wide range of users who either have internal rules for image builds (e.g. timestamp set to null as reported in #1797) or want a stable reliable pointer they can have control over (#746, #891). [1]: https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys [2]: http://label-schema.org/rc1/#build-time-labels
This adds support for overwriting the image created at timestamp with labels which are set during build. Supported labels (for now) are the Open Container Image (OCI) spec[1] and the (legacy) Label Schema (LS) spec[2]. We prioritize OCI over LS, with a fallback to the CreatedAt. This should serve a wide range of users who either have internal rules for image builds (e.g. timestamp set to null as reported in #1797) or want a stable reliable pointer they can have control over (#746, #891). [1]: https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys [2]: http://label-schema.org/rc1/#build-time-labels
I'm not sure if this is a Docker registry issue or a Flux issue, but the "created" timestamp seems to be based off of the image layers. This means that if a newer build ends up containing the same content as an older build, it will appear to be an older image and Flux will not upgrade.
The text was updated successfully, but these errors were encountered: