Skip to content

Commit 146bf83

Browse files
chore: Pinning KinD version for OS3 tests
Pinning KinD binary version to 0.7.0, compatible with Kubernetes v1.11. We're using that specific version to mimic an OS3 cluster in our integration tests.
1 parent 8988472 commit 146bf83

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

test/setup/platforms/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as kind from './kind';
22
import * as eks from './eks';
3+
import * as openshift3 from './openshift3';
34
import * as openshift4 from './openshift4';
45

56
interface IPlatformSetup {
@@ -42,7 +43,7 @@ const openshift3Setup: IPlatformSetup = {
4243
delete: kind.deleteCluster,
4344
config: kind.exportKubeConfig,
4445
clean: kind.clean,
45-
setupTester: kind.setupTester,
46+
setupTester: openshift3.setupTester,
4647
};
4748

4849
const openshift4Setup: IPlatformSetup = {

test/setup/platforms/kind.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const clusterName = 'kind';
77

88
export async function setupTester(): Promise<void> {
99
const osDistro = platform();
10-
await download(osDistro);
10+
await download(osDistro, 'v0.8.1');
1111
}
1212

1313
export async function createCluster(version: string): Promise<void> {
@@ -55,13 +55,13 @@ export async function clean(): Promise<void> {
5555
throw new Error('Not implemented');
5656
}
5757

58-
async function download(osDistro: string): Promise<void> {
58+
export async function download(osDistro: string, kindVersion: string): Promise<void> {
5959
try {
6060
accessSync(resolve(process.cwd(), 'kind'), constants.R_OK);
6161
} catch (error) {
62-
console.log('Downloading KinD...');
62+
console.log(`Downloading KinD ${kindVersion}...`);
6363

64-
const url = `https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-${osDistro}-amd64`;
64+
const url = `https://github.com/kubernetes-sigs/kind/releases/download/${kindVersion}/kind-${osDistro}-amd64`;
6565
await exec(`curl -Lo ./kind ${url}`);
6666
chmodSync('kind', 0o755); // rwxr-xr-x
6767

test/setup/platforms/openshift3.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { platform } from 'os';
2+
import { download } from '../platforms/kind';
3+
4+
export async function setupTester(): Promise<void> {
5+
const osDistro = platform();
6+
await download(osDistro, 'v0.7.0');
7+
}

0 commit comments

Comments
 (0)