Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively
()
| 26 | |
| 27 | // Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively |
| 28 | func (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 |
| 58 | func (d FileInput) Path() string { |
no test coverage detected