GetContainerPin returns the cached pin for the given image tag. Returns the pin and true if a digest pin is present, otherwise empty pin and false.
(image string)
| 58 | // GetContainerPin returns the cached pin for the given image tag. |
| 59 | // Returns the pin and true if a digest pin is present, otherwise empty pin and false. |
| 60 | func (c *ActionCache) GetContainerPin(image string) (ContainerPin, bool) { |
| 61 | if c.ContainerPins == nil { |
| 62 | return ContainerPin{}, false |
| 63 | } |
| 64 | pin, ok := c.ContainerPins[image] |
| 65 | if !ok { |
| 66 | actionCacheLog.Printf("Container pin cache miss for image=%s", image) |
| 67 | return ContainerPin{}, false |
| 68 | } |
| 69 | actionCacheLog.Printf("Container pin cache hit for image=%s, pinned=%s", image, pin.PinnedImage) |
| 70 | return pin, true |
| 71 | } |
| 72 | |
| 73 | // SetContainerPin stores a digest pin for the given image tag. |
| 74 | // digest must be in the form "sha256:<hex>" and pinnedImage must be the full |