MCPcopy Create free account
hub / github.com/github/gh-aw / lookupContainerPin

Function lookupContainerPin

pkg/workflow/action_pins.go:172–182  ·  view source on GitHub ↗

lookupContainerPin returns the ContainerPin for the given image, checking cache first then falling back to embedded pins. Returns false if the image is not pinned.

(image string, cache *ActionCache)

Source from the content-addressed store, hash-verified

170// lookupContainerPin returns the ContainerPin for the given image, checking cache first
171// then falling back to embedded pins. Returns false if the image is not pinned.
172func lookupContainerPin(image string, cache *ActionCache) (ContainerPin, bool) {
173 if cache != nil {
174 if pin, ok := cache.GetContainerPin(image); ok {
175 return pin, true
176 }
177 }
178 if pin, ok := getEmbeddedContainerPin(image); ok {
179 return pin, true
180 }
181 return ContainerPin{}, false
182}
183
184// resolveContainerImage returns the digest-pinned image reference when a cache or
185// embedded container pin exists for image; otherwise it returns the original image.

Callers 4

lookupContainerDigestFunction · 0.85
resolveContainerImageFunction · 0.85
applyContainerPinsFunction · 0.85

Calls 2

getEmbeddedContainerPinFunction · 0.85
GetContainerPinMethod · 0.80

Tested by 1