diff --git a/nanolayer/installers/gh_release/resolvers/asset_resolver.py b/nanolayer/installers/gh_release/resolvers/asset_resolver.py index 952a58cf..82a6958f 100644 --- a/nanolayer/installers/gh_release/resolvers/asset_resolver.py +++ b/nanolayer/installers/gh_release/resolvers/asset_resolver.py @@ -23,7 +23,7 @@ class AssetResolver: LinuxInformationDesk.Architecture.I386: r"(i386|\-386|_386)", LinuxInformationDesk.Architecture.I686: r"(i686|\-686|_686)", LinuxInformationDesk.Architecture.ARM32: r"([Aa]rm32|ARM32)", - LinuxInformationDesk.Architecture.ARM64: r"([Aa]rm64|ARM64|\-ARM|\-arm\-)", + LinuxInformationDesk.Architecture.ARM64: r"([Aa]rm64|ARM64)", LinuxInformationDesk.Architecture.S390: r"(s390x|s390)", LinuxInformationDesk.Architecture.PPC64: r"(\-ppc|ppc64|PPC64|_ppc)", LinuxInformationDesk.Architecture.x86_64: r"([Aa]md64|\-x64|x64|x86[_-]64)", @@ -286,6 +286,16 @@ def resolve( ), ] + # if arm64 - accept also simple "arm/ARM" mentions + if arch == LinuxInformationDesk.Architecture.ARM64: + positive_filters += [ + cls.FindAllRegexFilter( + name="prefer own distro-like", # prefer own distro like + regex=r"\-ARM\-?|\-arm\-", + negative=False, + ) + ] + bad_distros_regexes = { key: val for key, val in cls.DISTRO_REGEX_MAP.items() diff --git a/tests/installers/gh_release/test_gh_release_installer.py b/tests/installers/gh_release/test_gh_release_installer.py index 23ed9e91..457edc2e 100644 --- a/tests/installers/gh_release/test_gh_release_installer.py +++ b/tests/installers/gh_release/test_gh_release_installer.py @@ -206,6 +206,15 @@ "--asset-regex '^extractor\.linux-.+\.exe$' --no-filter-assets-by-platform", "linux/arm64", ), + ( + "trivy --version", + 0, + "mcr.microsoft.com/vscode/devcontainers/python:3.10-bullseye", + "aquasecurity/trivy", + "trivy", + "", + "linux/arm64", + ), ], ) def test_gh_release_install(