Getting image digest after push
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 72.1k
- Forks
- 19.2k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 164
Description
Description
Typically users rely on the Aux field to get at the digest following a successful push using ImagePush. Specifically, something like this can be done on the caller side, note the unmarshal into types.PushResult:
if message.Aux != nil {
var pushResult types.PushResult
if err := json.Unmarshal(*message.Aux, &pushResult); err == nil {
imageDigest = pushResult.Digest
}
}
However, in some scenarios (when containerd image store is enabled newer cli versions), the digest is returned in the Status as a plain string. And afaics the only way to get at the digest is to parse this raw string?
So, the question (or feature request), is it possible to standardize on a convention for getting the digest when reading from the io.ReadCloser.
I believe this request is in the same vein as https://github.com/moby/moby/issues/46528, but specifically for push.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/jsonmessage/jsonmessage.go and daemon/containerd/image_push.go, then compare the Aux-based caller example with the Status response described here. Review issue #46528 for related API context. Done means defining and documenting a consistent way to obtain the digest from ImagePush output across both response paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100