diff --git a/src/index.ts b/src/index.ts index 7fe3f97..c6dfea2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -213,10 +213,19 @@ async function downloadFile(url : string, downloadDir : string, * @returns The right asset name depended on the system */ function chooseKubescapeAsset() : string { + let prefix = "kubescape" + switch(os.arch()) { + case 'arm64': + prefix += "-arm64" + break + default: + break + } + const variants: { [key: string]: string } = { - "linux": "kubescape-ubuntu-latest", - "darwin": "kubescape-macos-latest", - "win32": "kubescape-windows-latest" + "linux": prefix + "-ubuntu-latest", + "darwin": prefix + "-macos-latest", + "win32": prefix + ".exe" }; return variants[os.platform()]; diff --git a/test/index.test.ts b/test/index.test.ts index d3e43ec..8bc1bc8 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -7,7 +7,7 @@ import { KubescapeApi, KubescapeUi, IKubescapeConfig } from '../src/index' const seconds = (n : number) => n * 1000 const minutes = (n : number) => n * 1000 * 60 -const DEFAULT_KUBESCAPE_VERSION = "v2.0.176"; +const DEFAULT_KUBESCAPE_VERSION = "v2.3.1"; class TestUi implements KubescapeUi { info(msg: string): void {