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

Method Entities

pkg/input/dir/source.go:46–61  ·  view source on GitHub ↗

Entities returns the entities of the requested type from the source. Errors if any invalid entities.

(t entity.Type, objects ...deploy.KubeObject)

Source from the content-addressed store, hash-verified

44
45// Entities returns the entities of the requested type from the source. Errors if any invalid entities.
46func (fs FileSource) Entities(t entity.Type, objects ...deploy.KubeObject) ([]entity.Entity, error) {
47 switch t {
48 case entity.EntityReplicationController:
49 return fs.rcs(objects)
50 case entity.EntityPod:
51 return fs.pods(objects)
52 case entity.EntityContainer:
53 return fs.containers(objects)
54 case entity.EntityImage:
55 // getting images not implemented
56 return []entity.Entity{}, nil
57 }
58
59 // if unknown type, return error
60 return []entity.Entity{}, ErrInvalidType
61}
62
63// Objects returns the Kubernetes objects available from the source. Errors if any invalid objects.
64func (fs FileSource) Objects() (objects []deploy.KubeObject, err error) {

Callers 9

BuildMethod · 0.80
TestSourceInvalidEntityFunction · 0.80
TestSourceEntitiesNoFileFunction · 0.80
TestSourceRCsFunction · 0.80
TestSourcePodsFunction · 0.80
TestSourceContainersDirFunction · 0.80
BuildMethod · 0.80
fileDeployMethod · 0.80

Calls 3

rcsMethod · 0.95
podsMethod · 0.95
containersMethod · 0.95

Tested by 6

TestSourceInvalidEntityFunction · 0.64
TestSourceEntitiesNoFileFunction · 0.64
TestSourceRCsFunction · 0.64
TestSourcePodsFunction · 0.64
TestSourceContainersDirFunction · 0.64