mirror of
https://github.com/containers/podman.git
synced 2025-06-25 20:26:51 +08:00
Merge pull request #7247 from baude/issue7122
Replace deepcopy on history results
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/containers/common/pkg/config"
|
"github.com/containers/common/pkg/config"
|
||||||
"github.com/containers/image/v5/docker/reference"
|
"github.com/containers/image/v5/docker/reference"
|
||||||
@ -73,8 +74,16 @@ func (ir *ImageEngine) History(ctx context.Context, nameOrID string, opts entiti
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, layer := range results {
|
for i, layer := range results {
|
||||||
hold := entities.ImageHistoryLayer{}
|
// Created time comes over as an int64 so needs conversion to time.time
|
||||||
_ = utils.DeepCopy(&hold, layer)
|
t := time.Unix(layer.Created, 0)
|
||||||
|
hold := entities.ImageHistoryLayer{
|
||||||
|
ID: layer.ID,
|
||||||
|
Created: t.UTC(),
|
||||||
|
CreatedBy: layer.CreatedBy,
|
||||||
|
Tags: layer.Tags,
|
||||||
|
Size: layer.Size,
|
||||||
|
Comment: layer.Comment,
|
||||||
|
}
|
||||||
history.Layers[i] = hold
|
history.Layers[i] = hold
|
||||||
}
|
}
|
||||||
return &history, nil
|
return &history, nil
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
load helpers
|
load helpers
|
||||||
|
|
||||||
@test "podman history - basic tests" {
|
@test "podman history - basic tests" {
|
||||||
skip_if_remote "FIXME: pending #7122"
|
|
||||||
|
|
||||||
tests="
|
tests="
|
||||||
| .*[0-9a-f]\\\{12\\\} .* CMD .* LABEL
|
| .*[0-9a-f]\\\{12\\\} .* CMD .* LABEL
|
||||||
--format '{{.ID}} {{.Created}}' | .*[0-9a-f]\\\{12\\\} .* ago
|
--format '{{.ID}} {{.Created}}' | .*[0-9a-f]\\\{12\\\} .* ago
|
||||||
|
Reference in New Issue
Block a user