MCPcopy Index your code
hub / github.com/regclient/regclient / imagePlatformInList

Function imagePlatformInList

image.go:1699–1720  ·  view source on GitHub ↗
(target *platform.Platform, list []string)

Source from the content-addressed store, hash-verified

1697}
1698
1699func imagePlatformInList(target *platform.Platform, list []string) (bool, error) {
1700 // special case for an unset platform
1701 if target == nil || target.OS == "" {
1702 if slices.Contains(list, "") {
1703 return true, nil
1704 }
1705 return false, nil
1706 }
1707 for _, entry := range list {
1708 if entry == "" {
1709 continue
1710 }
1711 plat, err := platform.Parse(entry)
1712 if err != nil {
1713 return false, err
1714 }
1715 if platform.Match(*target, plat) {
1716 return true, nil
1717 }
1718 }
1719 return false, nil
1720}
1721
1722// tarReadAll processes the tar file in a loop looking for matching filenames in the list of handlers.
1723// Handlers for filenames are added at the top level, and by manifest imports.

Callers 1

imageCopyOptMethod · 0.85

Calls 2

ParseFunction · 0.92
MatchFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…