Skip to content

crane: Flattened images' timestamps don't relate to actual creation time #2115

@Stephanie0829

Description

@Stephanie0829

Describe the bug

Re-opening #1996 for visibility.

When flattening an image the blob's created field is the same as the original image's, while the flattened layer's created field is a zero timestamp. This makes it impossible to figure out when was the flattened image actually created and distinguish it from the original.

To Reproduce

$ crane flatten -t flat-busybox:1.0 busybox:latest
$ crane blob "flat-busybox@$(crane manifest flat-busybox:1.0 | jq -j '.config.digest')" | jq | head -n6
{
  "architecture": "arm64",
  "created": "2024-07-10T12:35:23.027267803Z",
  "history": [
    {
      "created": "0001-01-01T00:00:00Z",

Expected behavior

Timestamps should indicate when an image was created.

Additional context

Output of crane version: 0.20.0
Registry used: Any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions