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

Method GetContainerPin

pkg/workflow/action_cache.go:60–71  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
60func (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

Calls 1

PrintfMethod · 0.45