Skip to content

Commit 302849d

Browse files
Merge pull request #640 from snyk/fix/skip-k8s-jobs-for-debugging
fix: skip k8s jobs processing behind FF for debug purpose
2 parents 384482b + eabd981 commit 302849d

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

snyk-monitor/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ spec:
7575
value: {{ .Values.no_proxy }}
7676
- name: LOG_LEVEL
7777
value: {{ .Values.log_level }}
78+
- name: SKIP_K8S_JOBS
79+
value: {{ .Values.skip_k8s_jobs }}
7880
{{- with .Values.envs }}
7981
{{- toYaml . | trim | nindent 10 -}}
8082
{{ end }}

snyk-monitor/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ limits:
6262
http_proxy:
6363
https_proxy:
6464
no_proxy:
65+
skip_k8s_jobs:
6566

6667
# Override default (INFO) log level if less verbosity needed
6768
log_level:

src/common/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ delete process.env['HTTPS_PROXY'];
2121
delete process.env['HTTP_PROXY'];
2222
delete process.env['NO_PROXY'];
2323

24+
config.SKIP_K8S_JOBS = process.env.SKIP_K8S_JOBS === 'true';
25+
2426
export { config };

src/supervisor/watchers/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ function setupWatchesForNamespace(namespace: string): void {
2626
logger.info({namespace}, 'setting up namespace watch');
2727

2828
for (const workloadKind of Object.values(WorkloadKind)) {
29+
// Disable handling events for k8s Jobs for debug purposes
30+
if (config.SKIP_K8S_JOBS === true && workloadKind === WorkloadKind.Job) {
31+
continue;
32+
}
33+
2934
try {
3035
setupInformer(namespace, workloadKind);
3136
} catch (error) {

0 commit comments

Comments
 (0)