MCPcopy Index your code
hub / github.com/docker-exec/dexec / LookupImageByOverride

Function LookupImageByOverride

dexec/dexec.go:166–183  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

164// DexecImage struct containing the image name & version, as well as the
165// file extension that was passed in.
166func 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}

Callers 2

ImageFromOptionsFunction · 0.85

Calls

no outgoing calls

Tested by 1