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

Method Build

pkg/input/dir/input.go:28–55  ·  view source on GitHub ↗

Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively

()

Source from the content-addressed store, hash-verified

26
27// Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively
28func (d *FileInput) Build() (entity.Entity, error) {
29 base, err := d.base()
30 if err != nil {
31 return nil, err
32 }
33
34 rcs, err := d.Entities(entity.EntityReplicationController)
35 if err != nil {
36 return nil, err
37 }
38
39 for _, rc := range rcs {
40 err = base.Attach(rc)
41 if err != nil {
42 return nil, err
43 }
44 }
45
46 pods, err := d.Entities(entity.EntityPod)
47
48 for _, pod := range pods {
49 err = base.Attach(pod)
50 if err != nil {
51 return nil, err
52 }
53 }
54 return base, err
55}
56
57// Path returns the location the fileInput was created
58func (d FileInput) Path() string {

Callers 2

BuildMethod · 0.95
fileDeployMethod · 0.95

Calls 3

baseMethod · 0.95
EntitiesMethod · 0.80
AttachMethod · 0.65

Tested by

no test coverage detected