Skip to content

Commit 2e71d12

Browse files
committed
chore: better API for our platform creation helpers
1 parent c8427a2 commit 2e71d12

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

test/setup/platforms/index.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
import * as kind from './kind';
22
import * as eks from './eks';
33

4+
interface IPlatformSetup {
5+
// create a Kubernetes cluster
6+
create: (imageNameAndTag: string) => Promise<void>;
7+
// delete a Kubernetes cluster
8+
delete: () => Promise<void>;
9+
// set KUBECONFIG to point at the tested cluster
10+
config: () => Promise<void>;
11+
}
12+
13+
const kindSetup: IPlatformSetup = {
14+
create: kind.createCluster,
15+
delete: kind.deleteCluster,
16+
config: kind.exportKubeConfig,
17+
};
18+
19+
const eksSetup: IPlatformSetup = {
20+
create: eks.createCluster,
21+
delete: eks.deleteCluster,
22+
config: eks.exportKubeConfig,
23+
}
24+
425
export default {
5-
kind: {create: kind.createCluster, delete: kind.deleteCluster, config: kind.exportKubeConfig},
6-
eks: {create: eks.createCluster, delete: eks.deleteCluster, config: eks.exportKubeConfig},
26+
kind: kindSetup,
27+
eks: eksSetup,
728
}

0 commit comments

Comments
 (0)