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

Function handleAux

cli/command/image/push.go:144–171  ·  view source on GitHub ↗
(notes *[]string, out tui.Output)

Source from the content-addressed store, hash-verified

142}
143
144func handleAux(notes *[]string, out tui.Output) func(jm jsonstream.JSONMessage) {
145 return func(jm jsonstream.JSONMessage) {
146 b := []byte(*jm.Aux)
147
148 var stripped auxprogress.ManifestPushedInsteadOfIndex
149 err := json.Unmarshal(b, &stripped)
150 if err == nil && stripped.ManifestPushedInsteadOfIndex {
151 note := fmt.Sprintf("Not all multiplatform-content is present and only the available single-platform image was pushed\n%s -> %s",
152 out.Color(aec.RedF).Apply(stripped.OriginalIndex.Digest.String()),
153 out.Color(aec.GreenF).Apply(stripped.SelectedManifest.Digest.String()),
154 )
155 *notes = append(*notes, note)
156 }
157
158 var missing auxprogress.ContentMissing
159 err = json.Unmarshal(b, &missing)
160 if err == nil && missing.ContentMissing {
161 note := `You're trying to push a manifest list/index which
162 references multiple platform specific manifests, but not all of them are available locally
163 or available to the remote repository.
164
165 Make sure you have all the referenced content and try again.
166
167 You can also push only a single platform specific manifest directly by specifying the platform you want to push with the --platform flag.`
168 *notes = append(*notes, note)
169 }
170 }
171}

Callers 1

runPushFunction · 0.85

Calls 3

ApplyMethod · 0.80
ColorMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…