MCPcopy
hub / github.com/redspread/spread / PushOptions

Method PushOptions

pkg/image/image.go:41–57  ·  view source on GitHub ↗

PushOptions returns the parameters needed to push an image.

(out io.Writer, json bool)

Source from the content-addressed store, hash-verified

39
40// PushOptions returns the parameters needed to push an image.
41func (i Image) PushOptions(out io.Writer, json bool) docker.PushImageOptions {
42 if i.image == nil {
43 return docker.PushImageOptions{}
44 }
45 name := strings.TrimPrefix(fullName(i.image), "docker.io/")
46 opts := docker.PushImageOptions{
47 Name: name,
48 Registry: hostname(i.image),
49 OutputStream: out,
50 RawJSONStream: json,
51 }
52
53 if i.tag {
54 opts.Tag = i.image.Tag()
55 }
56 return opts
57}
58
59// Equal returns if one image is the same as another
60func (i *Image) Equal(other *Image) bool {

Callers 7

TestParseNameFunction · 0.80
TestParseTagFunction · 0.80
TestParseUserNameFunction · 0.80
TestParseUserTagFunction · 0.80
TestParseRegistryUserTagFunction · 0.80
TestNonInitImageFunction · 0.80

Calls 2

fullNameFunction · 0.85
hostnameFunction · 0.85

Tested by 7

TestParseNameFunction · 0.64
TestParseTagFunction · 0.64
TestParseUserNameFunction · 0.64
TestParseUserTagFunction · 0.64
TestParseRegistryUserTagFunction · 0.64
TestNonInitImageFunction · 0.64