Merge pull request #46719 from rumpl/c8d-image-created-date
c8d: show the real image creation date when listing images
This commit is contained in:
commit
7d5445e312
1 changed files with 7 additions and 2 deletions
|
@ -29,6 +29,9 @@ import (
|
|||
|
||||
// Subset of ocispec.Image that only contains Labels
|
||||
type configLabels struct {
|
||||
// Created is the combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6.
|
||||
Created *time.Time `json:"created,omitempty"`
|
||||
|
||||
Config struct {
|
||||
Labels map[string]string `json:"Labels,omitempty"`
|
||||
} `json:"config,omitempty"`
|
||||
|
@ -277,9 +280,8 @@ func (i *ImageService) singlePlatformImage(ctx context.Context, contentStore con
|
|||
}
|
||||
|
||||
summary := &imagetypes.Summary{
|
||||
ParentID: "",
|
||||
ParentID: rawImg.Labels[imageLabelClassicBuilderParent],
|
||||
ID: target.String(),
|
||||
Created: rawImg.CreatedAt.Unix(),
|
||||
RepoDigests: repoDigests,
|
||||
RepoTags: repoTags,
|
||||
Size: totalSize,
|
||||
|
@ -291,6 +293,9 @@ func (i *ImageService) singlePlatformImage(ctx context.Context, contentStore con
|
|||
SharedSize: -1,
|
||||
Containers: -1,
|
||||
}
|
||||
if cfg.Created != nil {
|
||||
summary.Created = cfg.Created.Unix()
|
||||
}
|
||||
|
||||
if opts.ContainerCount {
|
||||
// Get container count
|
||||
|
|
Loading…
Add table
Reference in a new issue