Merge pull request #15 from CollinShoop/cshoop/add-mtime-to-blob-descriptor

Add mod time to registry blob descriptor
This commit is contained in:
Collin Shoop 2021-06-24 16:53:18 -04:00 committed by GitHub
commit 9f05a10c1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -66,6 +66,10 @@ type Descriptor struct {
// Size in bytes of content. // Size in bytes of content.
Size int64 `json:"size,omitempty"` Size int64 `json:"size,omitempty"`
// ModTime modification time for the file. For backends that
// don't have a modification time this may represent the creation time
ModTime time.Time
// Digest uniquely identifies the content. A byte stream can be verified // Digest uniquely identifies the content. A byte stream can be verified
// against this digest. // against this digest.
Digest digest.Digest `json:"digest,omitempty"` Digest digest.Digest `json:"digest,omitempty"`

View File

@ -200,6 +200,7 @@ func (bs *blobStatter) Stat(ctx context.Context, dgst digest.Digest) (distributi
// for the specific repository. // for the specific repository.
MediaType: "application/octet-stream", MediaType: "application/octet-stream",
Digest: dgst, Digest: dgst,
ModTime: fi.ModTime(),
}, nil }, nil
} }