Skip to content

Commit 00b3d88

Browse files
authored
Merge pull request #461 from snyk/chore/use_curl_to_download_kind
chore: replace needle get request for curl on kind setup
2 parents 653ed0e + d122374 commit 00b3d88

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

test/setup/platforms/kind.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { exec } from 'child-process-promise';
22
import { accessSync, chmodSync, constants, writeFileSync } from 'fs';
33
import { platform } from 'os';
44
import { resolve } from 'path';
5-
import * as needle from 'needle';
65

76
const clusterName = 'kind';
87

@@ -60,17 +59,9 @@ async function download(osDistro: string): Promise<void> {
6059
} catch (error) {
6160
console.log('Downloading KinD...');
6261

63-
const bodyData = null;
64-
// eslint-disable-next-line @typescript-eslint/camelcase
65-
const requestOptions = { follow_max: 2 };
66-
await needle('get',
67-
`https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-${osDistro}-amd64`,
68-
bodyData,
69-
requestOptions,
70-
).then((response) => {
71-
writeFileSync('kind', response.body);
72-
chmodSync('kind', 0o755); // rwxr-xr-x
73-
});
62+
const url = `https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-${osDistro}-amd64`;
63+
await exec(`curl -Lo ./kind ${url}`);
64+
chmodSync('kind', 0o755); // rwxr-xr-x
7465

7566
console.log('KinD downloaded!');
7667
}

0 commit comments

Comments
 (0)