Skip to content

Commit

Permalink
exporter: don’t keep timestamp for empty layer
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Oct 19, 2020
1 parent 85dd12d commit f9d7f1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exporter/containerimage/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@ func normalizeLayersAndHistory(remote *solver.Remote, history []ocispec.History,
var layerIndex int
for i, h := range history {
if !h.EmptyLayer {
if h.Created == nil {
h.Created = refMeta[layerIndex].createdAt
}
if remote.Descriptors[layerIndex].Digest == emptyGZLayer {
h.EmptyLayer = true
remote.Descriptors = append(remote.Descriptors[:layerIndex], remote.Descriptors[layerIndex+1:]...)
} else {
if h.Created == nil {
h.Created = refMeta[layerIndex].createdAt
}
layerIndex++
}
}
Expand Down

0 comments on commit f9d7f1c

Please sign in to comment.