Skip to content

Commit 46d7555

Browse files
authored
Merge pull request #964 from snyk/feat/package-upgrades
Feat/package upgrades
2 parents 694d284 + 22dc2f4 commit 46d7555

File tree

20 files changed

+333
-395
lines changed

20 files changed

+333
-395
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ COPY LICENSE /licenses/LICENSE
3333

3434
ENV NODE_ENV production
3535

36+
RUN yum upgrade -y
37+
3638
RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash -
3739
RUN yum install -y nodejs
3840

package-lock.json

Lines changed: 301 additions & 370 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"format:check": "prettier --check '{src,test}/**/*.{js,ts,json,yml}'"
3737
},
3838
"dependencies": {
39-
"@kubernetes/client-node": "^0.15.1",
39+
"@kubernetes/client-node": "^0.16.1",
4040
"@snyk/dep-graph": "^1.29.0",
4141
"async": "^3.2.2",
4242
"aws-sdk": "^2.1035.0",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { emptyDirSync } from 'fs-extra';
1+
import fsExtra = require('fs-extra');
22

33
import * as SourceMapSupport from 'source-map-support';
44

@@ -42,7 +42,7 @@ process.on('unhandledRejection', (reason, promise) => {
4242
function cleanUpTempStorage() {
4343
const { IMAGE_STORAGE_ROOT } = config;
4444
try {
45-
emptyDirSync(IMAGE_STORAGE_ROOT);
45+
fsExtra.emptyDirSync(IMAGE_STORAGE_ROOT);
4646
logger.info({}, 'Cleaned temp storage');
4747
} catch (err) {
4848
logger.error({ err }, 'Error deleting files');

src/scanner/images/skopeo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fs from 'fs';
2-
import * as sleep from 'sleep-promise';
2+
import sleep from 'sleep-promise';
33

44
import { logger } from '../../common/logger';
55
import { config } from '../../common/config';

src/state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { KubernetesObject, V1Namespace } from '@kubernetes/client-node';
2-
import * as LruCache from 'lru-cache';
2+
import LruCache from 'lru-cache';
33

44
import { config } from './common/config';
55

src/supervisor/kuberenetes-api-wrappers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as http from 'http';
2-
import * as sleep from 'sleep-promise';
2+
import sleep from 'sleep-promise';
33

44
import { logger } from '../common/logger';
55
import { IRequestError } from './types';

src/supervisor/watchers/handlers/deployment-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export async function paginatedDeploymentConfigList(
4343
namespace,
4444
'deploymentconfigs',
4545
pretty,
46+
_allowWatchBookmarks,
4647
_continue,
4748
fieldSelector,
4849
labelSelector,

src/supervisor/watchers/handlers/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ async function isSupportedWorkload(
134134
const continueToken = undefined;
135135
const fieldSelector = undefined;
136136
const labelSelector = undefined;
137+
const allowWatchBookmarks = undefined;
137138
const limit = 1; // Try to grab only a single object
138139
const resourceVersion = undefined; // List anything in the cluster
140+
const resourceVersionMatch = undefined;
139141
const timeoutSeconds = 10; // Don't block the snyk-monitor indefinitely
140142
const attemptedApiCall =
141143
await kubernetesApiWrappers.retryKubernetesApiRequest(() =>
@@ -145,11 +147,13 @@ async function isSupportedWorkload(
145147
namespace,
146148
'deploymentconfigs',
147149
pretty,
150+
allowWatchBookmarks,
148151
continueToken,
149152
fieldSelector,
150153
labelSelector,
151154
limit,
152155
resourceVersion,
156+
resourceVersionMatch,
153157
timeoutSeconds,
154158
),
155159
);

src/supervisor/watchers/handlers/pagination.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IncomingMessage } from 'http';
2-
import * as sleep from 'sleep-promise';
2+
import sleep from 'sleep-promise';
33
import type {
44
KubernetesListObject,
55
KubernetesObject,

0 commit comments

Comments
 (0)