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

Function NewImage

pkg/entity/image.go:19–32  ·  view source on GitHub ↗

NewImage creates a new Entity for the image.Image it's provided with.

(image *image.Image, defaults kube.ObjectMeta, source string, objects ...deploy.KubeObject)

Source from the content-addressed store, hash-verified

17
18// NewImage creates a new Entity for the image.Image it's provided with.
19func NewImage(image *image.Image, defaults kube.ObjectMeta, source string, objects ...deploy.KubeObject) (*Image, error) {
20 if image == nil {
21 return nil, ErrorNilImage
22 }
23
24 base, err := newBase(EntityImage, defaults, source, objects)
25 if err != nil {
26 return nil, err
27 } else if len(image.KubeImage()) == 0 {
28 return nil, ErrorEmptyImageString
29 }
30
31 return &Image{base: base, image: image}, nil
32}
33
34// Deployment is created with image attached to default pod. The GenerateName of the Pod
35// is the name of the image.

Callers 12

TestImageDeploymentFunction · 0.85
TestImageImagesFunction · 0.85
TestImageNilFunction · 0.85
TestImageInvalidFunction · 0.85
TestImageTypeFunction · 0.85
TestImageKubeFunction · 0.85
TestImageBadObjectFunction · 0.85
TestImageChildrenFunction · 0.85
testNewImageFunction · 0.85
TestBaseCheckAttachFunction · 0.85
TestPodAttachImageFunction · 0.85
NewContainerFunction · 0.85

Calls 2

newBaseFunction · 0.85
KubeImageMethod · 0.80

Tested by 11

TestImageDeploymentFunction · 0.68
TestImageImagesFunction · 0.68
TestImageNilFunction · 0.68
TestImageInvalidFunction · 0.68
TestImageTypeFunction · 0.68
TestImageKubeFunction · 0.68
TestImageBadObjectFunction · 0.68
TestImageChildrenFunction · 0.68
testNewImageFunction · 0.68
TestBaseCheckAttachFunction · 0.68
TestPodAttachImageFunction · 0.68