diff options
author | Colin Walters <walters@verbum.org> | 2022-01-19 19:36:45 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2022-01-20 18:02:58 -0500 |
commit | 2947ded7a8fced28fb3478f556194d12433145ad (patch) | |
tree | a2900ec5e478f15c31ee8270a75249d65b42a00f /pkg/domain/infra/abi/images.go | |
parent | 6b59b10248b0bd92127dfc455ca40579d4c396a0 (diff) | |
download | podman-2947ded7a8fced28fb3478f556194d12433145ad.tar.gz podman-2947ded7a8fced28fb3478f556194d12433145ad.tar.bz2 podman-2947ded7a8fced28fb3478f556194d12433145ad.zip |
Don't segfault if an image layer has no creation timestamp
It's optional in the specification, and I initially omitted
it in the ostree code. Now I've fixed the ostree code
to inject a timestamp, but we should clearly avoid segfaulting
on this case.
Signed-off-by: Colin Walters <walters@verbum.org>
Diffstat (limited to 'pkg/domain/infra/abi/images.go')
-rw-r--r-- | pkg/domain/infra/abi/images.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go index 3adf9b26c..b9c6d3ac7 100644 --- a/pkg/domain/infra/abi/images.go +++ b/pkg/domain/infra/abi/images.go @@ -94,7 +94,9 @@ func (ir *ImageEngine) Prune(ctx context.Context, opts entities.ImagePruneOption func toDomainHistoryLayer(layer *libimage.ImageHistory) entities.ImageHistoryLayer { l := entities.ImageHistoryLayer{} l.ID = layer.ID - l.Created = *layer.Created + if layer.Created != nil { + l.Created = *layer.Created + } l.CreatedBy = layer.CreatedBy copy(l.Tags, layer.Tags) l.Size = layer.Size |