LookupImageByOverride takes an image that has been specified by the user to use instead of the one in the extension map. This function returns a DexecImage struct containing the image name & version, as well as the file extension that was passed in.
(image string, extension string)
| 164 | // DexecImage struct containing the image name & version, as well as the |
| 165 | // file extension that was passed in. |
| 166 | func LookupImageByOverride(image string, extension string) (*Image, error) { |
| 167 | patternImage := regexp.MustCompile(`(.*):(.*)`) |
| 168 | imageMatch := patternImage.FindStringSubmatch(image) |
| 169 | if len(imageMatch) > 0 { |
| 170 | return &Image{ |
| 171 | "Unknown", |
| 172 | extension, |
| 173 | imageMatch[1], |
| 174 | imageMatch[2], |
| 175 | }, nil |
| 176 | } |
| 177 | return &Image{ |
| 178 | "Unknown", |
| 179 | extension, |
| 180 | image, |
| 181 | "latest", |
| 182 | }, nil |
| 183 | } |
no outgoing calls