diff options
author | Brent Baude <bbaude@redhat.com> | 2020-08-06 14:24:09 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-20 12:16:52 -0400 |
commit | c539091bb0346cca036f0b7c4c4fe4423dcc66ee (patch) | |
tree | 5d88144fab978b4b68cd1a7176a254359ec77944 /pkg/domain | |
parent | 09bd563e2bc544aa987e90c5d831f146198eebb5 (diff) | |
download | podman-c539091bb0346cca036f0b7c4c4fe4423dcc66ee.tar.gz podman-c539091bb0346cca036f0b7c4c4fe4423dcc66ee.tar.bz2 podman-c539091bb0346cca036f0b7c4c4fe4423dcc66ee.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 2e30621c5..2e027a6e1 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" @@ -65,8 +66,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 |