From 65496c55579ad0909ae31d16b406a41717a36fb9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 30 Oct 2025 20:22:25 +0100 Subject: [PATCH] cli/trust: use local definition for PushResult Aux message Signed-off-by: Sebastiaan van Stijn --- cli/trust/trust_push.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/trust/trust_push.go b/cli/trust/trust_push.go index ef7f19f1af7f..64f255964cf0 100644 --- a/cli/trust/trust_push.go +++ b/cli/trust/trust_push.go @@ -12,7 +12,6 @@ import ( "github.com/distribution/reference" "github.com/docker/cli/cli/streams" "github.com/docker/cli/internal/jsonstream" - "github.com/moby/moby/api/types" registrytypes "github.com/moby/moby/api/types/registry" "github.com/opencontainers/go-digest" "github.com/theupdateframework/notary/client" @@ -28,6 +27,15 @@ type Streams interface { Err() *streams.Out } +// PushResult contains the tag, manifest digest, and manifest size from the +// push. It's used to signal this information to the trust code in the client +// so it can sign the manifest if necessary. +type PushResult struct { + Tag string + Digest string + Size int +} + // PushTrustedReference pushes a canonical reference to the trust server. // //nolint:gocyclo @@ -45,7 +53,7 @@ func PushTrustedReference(ctx context.Context, ioStreams Streams, repoInfo *Repo return } - var pushResult types.PushResult + var pushResult PushResult err := json.Unmarshal(*msg.Aux, &pushResult) if err == nil && pushResult.Tag != "" { if dgst, err := digest.Parse(pushResult.Digest); err == nil {