Skip to content
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

Add CreatedSince & CreatedAt format fields to podman image history #14034

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Apr 27, 2022

Fixes: #14012

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2022
@@ -312,4 +312,19 @@ Deleted: $pauseID"
is "$output" ""
}

@test "podman image history" {
Copy link
Member

Choose a reason for hiding this comment

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

There's already a 110-history.bats, I wonder if some of this could be piggybacked there?

Comment on lines 26 to 30
| .CreatedAt | Time when the image layer was created |
| .CreatedBy | Command used to create the layer |
| .CreatedSince | Elapsed time since the image layer was created |
| .Size | Size of layer on disk |
| .Comment | Comment for the layer |
Copy link
Member

Choose a reason for hiding this comment

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

Bars on right-hand side need to be aligned

run_podman image history --format '{{.CreatedAt}}' $IMAGE
line="$lines[0]"
run cut -f1 -d'.' <<< "$line"
assert "${output}" == "$imageAt" "History image list should match .CreatedAt"
Copy link
Member

Choose a reason for hiding this comment

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

This fails on my laptop:

   #|     FAIL: History image list should match .CreatedAt
   #| expected: '2021-06-10 18:55:43 +0000 UTC'
   #|   actual: '2021-06-10 18:55:43'

Copy link
Member Author

Choose a reason for hiding this comment

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

Worked on my system, once. Will try again.

@rhatdan rhatdan force-pushed the history branch 2 times, most recently from 54ba8ce to 2a27e0d Compare April 27, 2022 17:24
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 27, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, rhatdan

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Comment on lines 59 to 67
run_podman image list --format '{{.CreatedSince}}' $IMAGE
imageSince="$output"
run_podman image list --format '{{.CreatedAt}}' $IMAGE
imageAt=$output
run_podman image history $IMAGE
run_podman image history --format '{{.CreatedSince}}' $IMAGE
is "${lines[0]}" "$imageSince" "History image list should match .CreatedSince"
run_podman image history --format '{{.CreatedAt}}' $IMAGE
assert "${lines[0]}" == "$imageAt" "History image list should match .CreatedAt"
Copy link
Member

Choose a reason for hiding this comment

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

LGTM but should you need to re-push for any reason, a small suggestion that reduces the number of podman calls (hence reduces CI time) and also runs sanity checks on the time values

@test "podman image history Created" {
    # Values from image LIST
    run_podman image list --format '{{.CreatedSince}}--{{.CreatedAt}}' $IMAGE
    from_imagelist="$output"
    assert "$from_imagelist" =~ "^[0-9].* ago--[0-9]+-[0-9]+-[0-9]+ [0-9:]+ " \
           "CreatedSince and CreatedAt look reasonable"

    # Values from image HISTORY
    run_podman image history --format '{{.CreatedSince}}--{{.CreatedAt}}' $IMAGE
    assert "${lines[0]}" == "$from_imagelist" \
           "CreatedSince and CreatedAt from image history should == image list"
}

Fixes: containers#14012

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@TomSweeneyRedHat
Copy link
Member

LGTM

@edsantiago
Copy link
Member

/lgtm
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 27, 2022
@edsantiago
Copy link
Member

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2022
@openshift-merge-robot openshift-merge-robot merged commit 7321f5e into containers:main Apr 27, 2022
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman images --format incompatibility with docker (again)
4 participants