api/types: remove PushResult type, and move internal

This type was used as Aux message for docker push, was not documented,
and only present for Docker Content Trust (which is deprecated).

This patch removes it from the API module, and moves the type internal.
We can stop sending this Aux message once DCT is fully phased out.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-10-31 00:44:41 +01:00
parent 43b48f1929
commit ebe464ea45
5 changed files with 39 additions and 27 deletions

View File

@@ -14,7 +14,6 @@ import (
"github.com/docker/distribution/manifest/schema2"
"github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/client"
apitypes "github.com/moby/moby/api/types"
"github.com/moby/moby/v2/daemon/internal/distribution/metadata"
"github.com/moby/moby/v2/daemon/internal/distribution/xfer"
"github.com/moby/moby/v2/daemon/internal/layer"
@@ -211,9 +210,20 @@ func (p *pusher) pushTag(ctx context.Context, ref reference.NamedTagged, id dige
return err
}
// 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.
//
// TODO(thaJeztah): this aux-type is only present for docker content trust, which is deprecated.
type pushResult struct {
Tag string
Digest string
Size int
}
// Signal digest to the trust client so it can sign the
// push, if appropriate.
progress.Aux(p.config.ProgressOutput, apitypes.PushResult{Tag: ref.Tag(), Digest: manifestDigest.String(), Size: len(canonicalManifest)})
progress.Aux(p.config.ProgressOutput, pushResult{Tag: ref.Tag(), Digest: manifestDigest.String(), Size: len(canonicalManifest)})
return nil
}

View File

@@ -22,7 +22,6 @@ import (
"github.com/containerd/platforms"
"github.com/distribution/reference"
"github.com/moby/go-archive/chrootarchive"
"github.com/moby/moby/api/types"
"github.com/moby/moby/api/types/events"
"github.com/moby/moby/api/types/plugin"
"github.com/moby/moby/api/types/registry"
@@ -464,8 +463,19 @@ func (pm *Manager) Push(ctx context.Context, name string, metaHeader http.Header
progress.Update(out, pj.names[j], "Upload complete")
}
// 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.
//
// TODO(thaJeztah): this aux-type is only present for docker content trust, which is deprecated.
type pushResult struct {
Tag string
Digest string
Size int
}
// Signal the client for content trust verification
progress.Aux(out, types.PushResult{Tag: ref.(reference.Tagged).Tag(), Digest: desc.Digest.String(), Size: int(desc.Size)})
progress.Aux(out, pushResult{Tag: ref.(reference.Tagged).Tag(), Digest: desc.Digest.String(), Size: int(desc.Size)})
return nil
}