DetectAll returns all containers that can handle the application
()
| 75 | |
| 76 | // DetectAll returns all containers that can handle the application |
| 77 | func (r *Registry) DetectAll() ([]Container, []string, error) { |
| 78 | var matched []Container |
| 79 | var names []string |
| 80 | |
| 81 | for _, container := range r.containers { |
| 82 | name, err := container.Detect() |
| 83 | if err != nil { |
| 84 | // Propagate errors (e.g., validation failures) |
| 85 | return nil, nil, err |
| 86 | } |
| 87 | if name != "" { |
| 88 | matched = append(matched, container) |
| 89 | names = append(names, name) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | return matched, names, nil |
| 94 | } |
| 95 | |
| 96 | // Get returns the container whose Detect() returns the given name, or nil if not found. |
| 97 | // Used by the finalize phase to resolve a container by the name stored in config.yml. |