Skip to content

Commit c8427a2

Browse files
committed
chore: cluster name simplification
our KinD helpers are a bit inconsistent in the decision regarding cluster name (allow the user to choose it or decide themselves). simplifying our platform setup APIs by keeping the decision in the helpers for consistency. if we need a sophistication later on, we will add it.
1 parent 692f79e commit c8427a2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

test/setup/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export async function deployMonitor(): Promise<string> {
137137
if (createCluster) {
138138
await platforms[testPlatform].create(imageNameAndTag);
139139
}
140-
await platforms[testPlatform].config('kind');
140+
await platforms[testPlatform].config();
141141
await createEnvironment();
142142
const integrationId = await installKubernetesMonitor(imageNameAndTag);
143143
await waiters.waitForMonitorToBeReady();

test/setup/platforms/eks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
export async function createCluster(imageNameAndTag: string): Promise<void> {
2-
exportKubeConfig('TODO');
2+
exportKubeConfig();
33
throw new Error('Not implemented');
44
// process.env.KUBECONFIG = 'path-to-/kubeconfig-aws';
55
}
66

7-
export async function deleteCluster(clusterName = 'kind'): Promise<void> {
7+
export async function deleteCluster(): Promise<void> {
88
throw new Error('Not implemented');
99
}
1010

11-
export async function exportKubeConfig(clusterName): Promise<void> {
11+
export async function exportKubeConfig(): Promise<void> {
1212
throw new Error('Not implemented');
1313
}

test/setup/platforms/kind.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ import { platform } from 'os';
44
import { resolve } from 'path';
55
import * as needle from 'needle';
66

7+
const clusterName = 'kind';
8+
79
export async function createCluster(imageNameAndTag: string): Promise<void> {
810
const osDistro = platform();
911
await download(osDistro);
10-
const clusterName = 'kind';
1112
await createKindCluster(clusterName);
12-
await exportKubeConfig(clusterName); // Don't worry, removing this soon!
1313
await loadImageInCluster(imageNameAndTag);
1414
}
1515

16-
export async function deleteCluster(clusterName = 'kind'): Promise<void> {
16+
export async function deleteCluster(): Promise<void> {
1717
console.log(`Deleting cluster ${clusterName}...`);
1818
await exec(`./kind delete cluster --name=${clusterName}`);
1919
console.log(`Deleted cluster ${clusterName}!`);
2020
}
2121

22-
export async function exportKubeConfig(clusterName): Promise<void> {
22+
export async function exportKubeConfig(): Promise<void> {
2323
console.log('Exporting K8s config...');
2424
const kindResponse = await exec(`./kind get kubeconfig-path --name="${clusterName}"`);
2525
const configPath = kindResponse.stdout.replace(/[\n\t\r]/g, '');

0 commit comments

Comments
 (0)