diff options
author | Brent Baude <bbaude@redhat.com> | 2020-08-06 14:24:09 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-08-11 12:19:17 -0500 |
commit | be41c58f25a34b53bb2af4327b421bc459609faf (patch) | |
tree | 1bfdf7c244a0034b4d5b4ff8d59b3e73848b9d92 /pkg/domain | |
parent | 6d3075a6c79a6e761c183e0d5e6aa239fad21b63 (diff) | |
download | podman-be41c58f25a34b53bb2af4327b421bc459609faf.tar.gz podman-be41c58f25a34b53bb2af4327b421bc459609faf.tar.bz2 podman-be41c58f25a34b53bb2af4327b421bc459609faf.zip |
Replace deepcopy on history results
the deepcopy in the remote history code path was throwing an uncaught error on a type mismatch. we now manually do the conversion and fix the type mismatch on the fly.
Fixes: #7122
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/domain')
-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 |