Skip to content

Commit aa2ab5c

Browse files
authored
Merge pull request #704 from snyk/fix/keep-alive-informer
fix: upgrade K8s client library to add Keep Alive to watches
2 parents 935b434 + f6cd596 commit aa2ab5c

22 files changed

+190
-43
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ RUN chmod 755 /usr/bin/dumb-init
3434
RUN groupadd -g 10001 snyk
3535
RUN useradd -g snyk -d /srv/app -u 10001 snyk
3636

37+
# @kubernetes/[email protected] started using net-keepalive, which requires the following packages to build modules
38+
RUN yum --disableplugin=subscription-manager install -y make gcc gcc-c++
39+
3740
WORKDIR /srv/app
3841

3942
COPY --chown=snyk:snyk --from=skopeo-build /usr/bin/skopeo /usr/bin/skopeo
@@ -50,6 +53,8 @@ RUN mkdir -p .config
5053

5154
RUN npm install
5255

56+
RUN yum remove -y make gcc gcc-c++
57+
5358
# add the rest of the app files
5459
ADD --chown=snyk:snyk . .
5560

package-lock.json

Lines changed: 107 additions & 35 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
@@ -33,7 +33,7 @@
3333
"lint": "eslint \"src/**/*.ts\" && (cd test && eslint \"**/*.ts\")"
3434
},
3535
"dependencies": {
36-
"@kubernetes/client-node": "^0.14.0",
36+
"@kubernetes/client-node": "^0.14.2",
3737
"@snyk/dep-graph": "^1.28.0",
3838
"async": "^3.2.0",
3939
"aws-sdk": "^2.867.0",

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ All integration tests require the Kubernetes-Monitor to be built into an image o
4949
The easiest way to achieve it is by running the `scripts/docker/build-image.sh` script.
5050
Please note that `docker` needs to be installed in order for this script to succeed.
5151

52-
As part of these tests, we attempt pulling and scanning an image hosted on a private GCR registry. For this test case to work, one has to define the following environment variables: `GCR_IO_SERVICE_ACCOUNT`, `GCR_IO_DOCKERCFG`.
52+
As part of these tests, we attempt pulling and scanning an image hosted on a private GCR registry. For this test case to work, one has to define the following environment variables: `GCR_IO_SERVICE_ACCOUNT`, `GCR_IO_DOCKERCFG`, `DOCKER_HUB_RO_USERNAME`, `DOCKER_HUB_RO_PASSWORD`.
5353

5454
Our integration tests may use different Kubernetes platforms to host the Kubernetes-Monitor. These platforms may use an existing cluster, or create a new one. Both decisions are based on the environment variables:
5555
* `TEST_PLATFORM` (`kind`, `kindolm`, `eks`)

test/fixtures/alpine-pod.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ metadata:
66
labels:
77
app: alpine
88
spec:
9+
imagePullSecrets:
10+
- name: docker-io
911
containers:
1012
- name: alpine
1113
image: alpine

test/fixtures/binaries-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ spec:
1515
labels:
1616
app: binaries
1717
spec:
18+
imagePullSecrets:
19+
- name: docker-io
1820
containers:
1921
- name: node
2022
image: node@sha256:215a9fbef4df2c1ceb7c79481d3cfd94ad8f1f0105bade39f3be907bf386c5e1

test/fixtures/centos-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ spec:
1414
labels:
1515
app.kubernetes.io/name: centos
1616
spec:
17+
imagePullSecrets:
18+
- name: docker-io
1719
containers:
1820
- image: centos:7
1921
imagePullPolicy: Always

test/fixtures/consul-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ spec:
1515
labels:
1616
app.kubernetes.io/name: consul
1717
spec:
18+
imagePullSecrets:
19+
- name: docker-io
1820
containers:
1921
- image: snyk/runtime-fixtures:consul
2022
imagePullPolicy: Always

test/fixtures/insecure-registries/push-dockerhub-image-to-local-registry.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ metadata:
55
spec:
66
template:
77
spec:
8+
imagePullSecrets:
9+
- name: docker-io
810
containers:
911
- name: my-container
1012
image: golang:1.13.1-alpine3.10

test/fixtures/java-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ spec:
1515
labels:
1616
app.kubernetes.io/name: java
1717
spec:
18+
imagePullSecrets:
19+
- name: docker-io
1820
containers:
1921
- image: java:latest
2022
imagePullPolicy: Always

0 commit comments

Comments
 (0)