SetContainerPin stores a digest pin for the given image tag. digest must be in the form "sha256: " and pinnedImage must be the full reference including the digest (e.g., "node:lts-alpine@sha256: ").
(image, digest, pinnedImage string)
| 74 | // digest must be in the form "sha256:<hex>" and pinnedImage must be the full |
| 75 | // reference including the digest (e.g., "node:lts-alpine@sha256:<hex>"). |
| 76 | func (c *ActionCache) SetContainerPin(image, digest, pinnedImage string) { |
| 77 | if c.ContainerPins == nil { |
| 78 | c.ContainerPins = make(map[string]ContainerPin) |
| 79 | } |
| 80 | c.ContainerPins[image] = ContainerPin{ |
| 81 | Image: image, |
| 82 | Digest: digest, |
| 83 | PinnedImage: pinnedImage, |
| 84 | } |
| 85 | c.dirty = true |
| 86 | actionCacheLog.Printf("Set container pin: image=%s, digest=%s", image, digest) |
| 87 | } |
| 88 | |
| 89 | // DeleteContainerPin removes the pin for the given image tag. |
| 90 | // It is a no-op if the image has no cached pin. |