Get returns the container whose Detect() returns the given name, or nil if not found. Used by the finalize phase to resolve a container by the name stored in config.yml.
(name string)
| 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. |
| 98 | func (r *Registry) Get(name string) Container { |
| 99 | for _, container := range r.containers { |
| 100 | detected, err := container.Detect() |
| 101 | if err == nil && detected == name { |
| 102 | return container |
| 103 | } |
| 104 | } |
| 105 | return nil |
| 106 | } |
| 107 | |
| 108 | // RegisterStandardContainers registers all standard containers in the correct priority order. |
| 109 | // This ensures Supply and Finalize phases use the same detection order. |
no test coverage detected