Entities returns the entities of the requested type from the source. Errors if any invalid entities.
(t entity.Type, objects ...deploy.KubeObject)
| 44 | |
| 45 | // Entities returns the entities of the requested type from the source. Errors if any invalid entities. |
| 46 | func (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. |
| 64 | func (fs FileSource) Objects() (objects []deploy.KubeObject, err error) { |