diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-11 16:25:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 16:25:05 -0400 |
commit | 8eaacec150df782c291e9c6046bb0db010dd2f08 (patch) | |
tree | dd62a34005fcf41343e3b15fa4076742b6887745 /pkg | |
parent | 43f277156c52141c89025ed6a3854f870db38033 (diff) | |
parent | be41c58f25a34b53bb2af4327b421bc459609faf (diff) | |
download | podman-8eaacec150df782c291e9c6046bb0db010dd2f08.tar.gz podman-8eaacec150df782c291e9c6046bb0db010dd2f08.tar.bz2 podman-8eaacec150df782c291e9c6046bb0db010dd2f08.zip |
Merge pull request #7247 from baude/issue7122
Replace deepcopy on history results
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/domain/infra/tunnel/images.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go index c7bfdcd2b..b255c5da4 100644 --- a/pkg/domain/infra/tunnel/images.go +++ b/pkg/domain/infra/tunnel/images.go @@ -9,6 +9,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/containers/common/pkg/config" "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 { - hold := entities.ImageHistoryLayer{} - _ = utils.DeepCopy(&hold, layer) + // Created time comes over as an int64 so needs conversion to time.time + 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 } return &history, nil |