Skip to content

Commit be78a00

Browse files
author
Amir Moualem
authored
Merge pull request #266 from snyk/chore/change-eks-cluster
Chore/change eks cluster
2 parents 2a6d3ad + 8944fee commit be78a00

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

test/setup/index.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ function createTestYamlDeployment(
2626
newYamlPath: string,
2727
integrationId: string,
2828
imageNameAndTag: string,
29+
imagePullPolicy: string,
2930
): void {
3031
console.log('Creating test deployment...');
3132
const originalDeploymentYaml = readFileSync('./snyk-monitor-deployment.yaml', 'utf8');
3233
const deployment = parse(originalDeploymentYaml);
3334

3435
deployment.spec.template.spec.containers[0].image = imageNameAndTag;
35-
deployment.spec.template.spec.containers[0].imagePullPolicy = 'Never';
36+
deployment.spec.template.spec.containers[0].imagePullPolicy = imagePullPolicy;
3637

3738
// This is important due to an odd bug when running on Travis.
3839
// By adding the Google nameserver, the container can start resolving external hosts.
@@ -105,7 +106,10 @@ async function createSecretForGcrIoAccess(): Promise<void> {
105106
);
106107
}
107108

108-
async function installKubernetesMonitor(imageNameAndTag: string): Promise<string> {
109+
async function installKubernetesMonitor(
110+
imageNameAndTag: string,
111+
imagePullPolicy: string,
112+
): Promise<string> {
109113
const namespace = 'snyk-monitor';
110114
await kubectl.createNamespace(namespace);
111115

@@ -118,7 +122,7 @@ async function installKubernetesMonitor(imageNameAndTag: string): Promise<string
118122
});
119123

120124
const testYaml = 'snyk-monitor-test-deployment.yaml';
121-
createTestYamlDeployment(testYaml, integrationId, imageNameAndTag);
125+
createTestYamlDeployment(testYaml, integrationId, imageNameAndTag, imagePullPolicy);
122126

123127
await kubectl.applyK8sYaml('./snyk-monitor-cluster-permissions.yaml');
124128
await kubectl.applyK8sYaml('./snyk-monitor-test-deployment.yaml');
@@ -146,7 +150,11 @@ export async function deployMonitor(): Promise<string> {
146150
await platforms[testPlatform].config();
147151
await createEnvironment();
148152
await createSecretForGcrIoAccess();
149-
const integrationId = await installKubernetesMonitor(remoteImageName);
153+
154+
// TODO: hack, rewrite this
155+
const imagePullPolicy = testPlatform === 'kind' ? 'Never' : 'Always';
156+
157+
const integrationId = await installKubernetesMonitor(remoteImageName, imagePullPolicy);
150158
await waiters.waitForMonitorToBeReady();
151159
console.log(`Deployed the snyk-monitor with integration ID ${integrationId}`);
152160
return integrationId;

test/setup/platforms/eks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function deleteCluster(): Promise<void> {
1010
}
1111

1212
export async function exportKubeConfig(): Promise<void> {
13-
await exec('aws eks update-kubeconfig --name runtime-experiments --kubeconfig ./kubeconfig');
13+
await exec('aws eks update-kubeconfig --name runtime-integration-test --kubeconfig ./kubeconfig');
1414
process.env.KUBECONFIG = './kubeconfig';
1515
}
1616

0 commit comments

Comments
 (0)