Skip to content

Commit a42f330

Browse files
committed
chore: bump KinD version
as part of the version bump, KinD is deprecating the "get kubeconfig-path". instead, they alter supposedly the default kubeconfig file, and recommend to use it through the context flag. this makes our testing infra a bit more complex because we're using sometimes the Kubernetes API client and sometimes kubectl. an easy workaround I have chosen was to dump kubeconfig's content to a new file, and just export its location as we used to.
1 parent 54191d2 commit a42f330

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ config.local.json
4747
# test utilities
4848
kind
4949
kubectl
50+
kubeconfig-integration-test-kind
51+
snyk-monitor-test-deployment.yaml

test/setup/platforms/kind.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ export async function deleteCluster(): Promise<void> {
2020

2121
export async function exportKubeConfig(): Promise<void> {
2222
console.log('Exporting K8s config...');
23-
const kindResponse = await exec(`./kind get kubeconfig-path --name="${clusterName}"`);
24-
const configPath = kindResponse.stdout.replace(/[\n\t\r]/g, '');
23+
const kubeconfigResult = await exec('./kind get kubeconfig');
24+
const kubeconfigContent = kubeconfigResult.stdout;
25+
const configPath = './kubeconfig-integration-test-kind';
26+
writeFileSync(configPath, kubeconfigContent);
2527
process.env.KUBECONFIG = configPath;
2628
console.log('Exported K8s config!');
2729
}
@@ -48,7 +50,7 @@ async function download(osDistro: string): Promise<void> {
4850
// eslint-disable-next-line @typescript-eslint/camelcase
4951
const requestOptions = { follow_max: 2 };
5052
await needle('get',
51-
`https://github.com/kubernetes-sigs/kind/releases/download/v0.3.0/kind-${osDistro}-amd64`,
53+
`https://github.com/kubernetes-sigs/kind/releases/download/v0.6.1/kind-${osDistro}-amd64`,
5254
bodyData,
5355
requestOptions,
5456
).then((response) => {

0 commit comments

Comments
 (0)