MCPcopy Index your code
hub / github.com/docker/cli / buildPushRequest

Function buildPushRequest

cli/command/manifest/push.go:93–122  ·  view source on GitHub ↗
(manifests []types.ImageManifest, targetRef reference.Named, insecure bool)

Source from the content-addressed store, hash-verified

91}
92
93func buildPushRequest(manifests []types.ImageManifest, targetRef reference.Named, insecure bool) (pushRequest, error) {
94 req := pushRequest{targetRef: targetRef, insecure: insecure}
95
96 var err error
97 req.list, err = buildManifestList(manifests, targetRef)
98 if err != nil {
99 return req, err
100 }
101
102 targetRepoName := reference.Path(reference.TrimNamed(targetRef))
103
104 for _, imageManifest := range manifests {
105 manifestRepoName := reference.Path(reference.TrimNamed(imageManifest.Ref))
106 repoName, _ := reference.WithName(manifestRepoName)
107 if repoName.Name() != targetRepoName {
108 blobs, err := buildBlobRequestList(imageManifest, repoName)
109 if err != nil {
110 return req, err
111 }
112 req.manifestBlobs = append(req.manifestBlobs, blobs...)
113
114 manifestPush, err := buildPutManifestRequest(imageManifest, targetRef)
115 if err != nil {
116 return req, err
117 }
118 req.mountRequests = append(req.mountRequests, manifestPush)
119 }
120 }
121 return req, nil
122}
123
124func buildManifestList(manifests []types.ImageManifest, targetRef reference.Named) (*manifestlist.DeserializedManifestList, error) {
125 targetRepo := reference.TrimNamed(targetRef)

Callers 1

runPushFunction · 0.85

Calls 5

buildManifestListFunction · 0.85
buildBlobRequestListFunction · 0.85
buildPutManifestRequestFunction · 0.85
PathMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…