(ctx context.Context, dockerCli command.Cli, opts pushOpts)
| 63 | } |
| 64 | |
| 65 | func runPush(ctx context.Context, dockerCli command.Cli, opts pushOpts) error { |
| 66 | targetRef, err := normalizeReference(opts.target) |
| 67 | if err != nil { |
| 68 | return err |
| 69 | } |
| 70 | |
| 71 | manifests, err := newManifestStore(dockerCli).GetList(targetRef) |
| 72 | if err != nil { |
| 73 | return err |
| 74 | } |
| 75 | if len(manifests) == 0 { |
| 76 | return fmt.Errorf("%s not found", targetRef) |
| 77 | } |
| 78 | |
| 79 | req, err := buildPushRequest(manifests, targetRef, opts.insecure) |
| 80 | if err != nil { |
| 81 | return err |
| 82 | } |
| 83 | |
| 84 | if err := pushList(ctx, dockerCli, req); err != nil { |
| 85 | return err |
| 86 | } |
| 87 | if opts.purge { |
| 88 | return newManifestStore(dockerCli).Remove(targetRef) |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | func buildPushRequest(manifests []types.ImageManifest, targetRef reference.Named, insecure bool) (pushRequest, error) { |
| 94 | req := pushRequest{targetRef: targetRef, insecure: insecure} |
no test coverage detected
searching dependent graphs…