Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ARM64 binaries as well as kubescape.exe #3

Merged
merged 1 commit into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
HollowMan6 marked this conversation as resolved.
Show resolved Hide resolved
};

return variants[os.platform()];
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down