|
1 | | -import { CoreV1Api, KubeConfig } from '@kubernetes/client-node'; |
| 1 | +import { CoreV1Api, KubeConfig, AppsV1Api } from '@kubernetes/client-node'; |
2 | 2 | import setup = require('../setup'); |
3 | 3 | import * as tap from 'tap'; |
4 | 4 | import { getKindConfigPath } from '../helpers/kind'; |
|
9 | 9 | validateHomebaseStoredMetadata, |
10 | 10 | getHomebaseResponseBody, |
11 | 11 | } from '../helpers/homebase'; |
| 12 | +import { validateSecureConfiguration } from '../helpers/deployment'; |
12 | 13 |
|
13 | 14 | let integrationId: string; |
14 | 15 |
|
@@ -162,3 +163,19 @@ tap.test(`snyk-monitor has resource limits`, async (t) => { |
162 | 163 | t.ok(monitorResources.requests.cpu !== undefined, 'snyk-monitor has cpu resource request'); |
163 | 164 | t.ok(monitorResources.requests.memory !== undefined, 'snyk-monitor has memory resource request'); |
164 | 165 | }); |
| 166 | + |
| 167 | +tap.test('snyk-monitor secure configuration is as expected', async (t) => { |
| 168 | + const kindConfigPath = await getKindConfigPath(); |
| 169 | + const kubeConfig = new KubeConfig(); |
| 170 | + kubeConfig.loadFromFile(kindConfigPath); |
| 171 | + |
| 172 | + const k8sApi = kubeConfig.makeApiClient(AppsV1Api); |
| 173 | + |
| 174 | + const response = await k8sApi.readNamespacedDeployment( |
| 175 | + 'snyk-monitor', |
| 176 | + 'snyk-monitor', |
| 177 | + ); |
| 178 | + const deployment = response.body; |
| 179 | + |
| 180 | + validateSecureConfiguration(t, deployment); |
| 181 | +}); |
0 commit comments