Skip to content

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Oct 20, 2025

This change adds a CREATED column to the podman artifact ls command output, displaying the artifact creation time in human-readable format (e.g., "3 weeks ago"), similar to podman image ls.

The creation time is extracted from the org.opencontainers.image.created annotation stored in the artifact manifest and formatted using units.HumanDuration.

Changes:

  • Add Created field to artifactListOutput struct
  • Parse and format creation time from manifest annotations
  • Update default output format to include CREATED column
  • Update documentation with Created placeholder
  • Add test to verify Created column is displayed

Fixes #27314

Does this PR introduce a user-facing change?

Podman artifact ls now lists the time the artifact was created.

Copy link
Contributor

openshift-ci bot commented Oct 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rhatdan
Once this PR has been reviewed and has the lgtm label, please assign l0rd for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@mheon
Copy link
Member

mheon commented Oct 20, 2025

Did we decide that these commands are stable? This is technically a CLI interface break.

@rhatdan
Copy link
Member Author

rhatdan commented Oct 21, 2025

Since I am probably the first one to use these interfaces, I would say no, it was not stable in the past, I have found too many issues.

Adding more information to the output, does not seem like a real break to me. Not having this information in the output is what I would consider a bug.

@baude
Copy link
Member

baude commented Oct 21, 2025

I'm not against adding the column but I do object to you finding too many issues. The artifact command was considered stable. And it was doing everything as designed for at the time.

}

// Get the created time from the manifest annotations
created := "<unknown>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think created should be blank if nothing is found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just grepped around and I dont think we do this with other objects.

created := "<unknown>"
if lr.Artifact.Manifest != nil && lr.Artifact.Manifest.Annotations != nil {
if createdStr, ok := lr.Artifact.Manifest.Annotations[imgspec.AnnotationCreated]; ok {
if createdTime, err := time.Parse(time.RFC3339Nano, createdStr); err == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we logrus if we find "bad" input?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, I am fine with moving to "" for created time.

This change adds a CREATED column to the podman artifact ls command output,
displaying the artifact creation time in human-readable format (e.g.,
"3 weeks ago"), similar to podman image ls.

The creation time is extracted from the org.opencontainers.image.created
annotation stored in the artifact manifest and formatted using
units.HumanDuration.

Changes:
- Add Created field to artifactListOutput struct
- Parse and format creation time from manifest annotations
- Update default output format to include CREATED column
- Update documentation with Created placeholder
- Add test to verify Created column is displayed

Fixes containers#27314

Co-authored-by: Cursor AI <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
@rhatdan
Copy link
Member Author

rhatdan commented Oct 21, 2025

Do not take offense on reporting issues, but:
I would say the issues made working with it much more difficult then other key Podman commands.

No saved creation time.
Missing Creation time on list output
Default to hidden tag rather then add :latest
No way to inspect with --format
No artifact rm --ignore
podman inspect  not working on artifacts.
Inability to modify the mounted artifact name. (This one was impossible to work around)

While tools using podman artifact can work around a lot of these, it makes it a lot easier to handle when the functionality matches other commands.

@mheon
Copy link
Member

mheon commented Oct 21, 2025

Closing in favor of #27319

@mheon mheon closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman artifact ls should show the artifact creation time.

3 participants