Skip to content

Commit

Permalink
fix last-history-created (aquasecurity#4697)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliDatadog committed Jun 26, 2023
1 parent 85c681d commit f84417b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/fanal/image/daemon/containerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,17 @@ func inspect(ctx context.Context, img containerd.Image, ref refdocker.Reference)
portSet[nat.Port(k)] = struct{}{}
}

created := ""
if lastHistory.Created != nil {
created = lastHistory.Created.Format(time.RFC3339Nano)
}

return api.ImageInspect{
ID: imgConfigDesc.Digest.String(),
RepoTags: []string{fmt.Sprintf("%s:%s", repository, tag)},
RepoDigests: []string{fmt.Sprintf("%s@%s", repository, img.Target().Digest)},
Comment: lastHistory.Comment,
Created: lastHistory.Created.Format(time.RFC3339Nano),
Created: created,
Author: lastHistory.Author,
Config: &container.Config{
User: imgConfig.Config.User,
Expand Down

0 comments on commit f84417b

Please sign in to comment.