-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Conversation
test/system/010-images.bats
Outdated
@@ -312,4 +312,19 @@ Deleted: $pauseID" | |||
is "$output" "" | |||
} | |||
|
|||
@test "podman image history" { |
There was a problem hiding this comment.
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?
| .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 | |
There was a problem hiding this comment.
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
test/system/010-images.bats
Outdated
run_podman image history --format '{{.CreatedAt}}' $IMAGE | ||
line="$lines[0]" | ||
run cut -f1 -d'.' <<< "$line" | ||
assert "${output}" == "$imageAt" "History image list should match .CreatedAt" |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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.
54ba8ce
to
2a27e0d
Compare
[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 |
test/system/110-history.bats
Outdated
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" |
There was a problem hiding this comment.
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>
LGTM |
/lgtm |
/hold cancel |
Fixes: #14012
Signed-off-by: Daniel J Walsh dwalsh@redhat.com