| 142 | } |
| 143 | |
| 144 | func 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 | } |