(target *platform.Platform, list []string)
| 1697 | } |
| 1698 | |
| 1699 | func 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. |
no test coverage detected
searching dependent graphs…