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)
| 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. |
| 172 | func 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. |