Skip to content

Commit fa2b4bd

Browse files
Merge pull request #163 from appuio/fix/logforwarder-outputs
Fix ClusterLogForwarder default pipelines
2 parents 232a6a4 + 09cc187 commit fa2b4bd

File tree

4 files changed

+3
-55
lines changed

4 files changed

+3
-55
lines changed

component/log_forwarder.libsonnet

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@ local params = inv.parameters.openshift4_logging;
77
local lokiEnabled = params.components.lokistack.enabled;
88
local forwarderEnabled = lokiEnabled || std.length(params.clusterLogForwarder) > 0;
99

10-
// Make sure the default output is added to the pipelines `outputRefs`,
11-
// if the logging stack is not disabled.
12-
local pipelineOutputRefs(pipeline) =
13-
local default = if lokiEnabled then [ 'default' ] else [];
14-
std.get(pipeline, 'forwarders', []) + default;
15-
1610
// clusterLogForwarderSpec:
1711
// Consecutively apply patches to result of previous apply.
1812
local clusterLogForwarderSpec = {
19-
local appsPipeline = std.get(std.get(params.clusterLogForwarder, 'pipelines', {}), 'application-logs', {}),
20-
local infraPipeline = std.get(std.get(params.clusterLogForwarder, 'pipelines', {}), 'infrastructure-logs', {}),
21-
local auditPipeline = std.get(std.get(params.clusterLogForwarder, 'pipelines', {}), 'audit-logs', {}),
22-
2313
managementState: 'Managed',
2414
collector: {
2515
resources: {
@@ -39,19 +29,7 @@ local clusterLogForwarderSpec = {
3929
filters: {},
4030
inputs: {},
4131
outputs: {},
42-
pipelines: {
43-
[if lokiEnabled || std.length(appsPipeline) > 0 then 'application-logs']: {
44-
inputRefs: [ 'application' ],
45-
outputRefs: pipelineOutputRefs(appsPipeline),
46-
},
47-
[if lokiEnabled || std.length(infraPipeline) > 0 then 'infrastructure-logs']: {
48-
inputRefs: [ 'infrastructure' ],
49-
outputRefs: pipelineOutputRefs(infraPipeline),
50-
},
51-
[if std.length(auditPipeline) > 0 then 'audit-logs']: {
52-
inputRefs: [ 'audit' ],
53-
},
54-
},
32+
pipelines: {},
5533
} + com.makeMergeable(params.clusterLogForwarder);
5634

5735
// Unfold objects into array for ClusterLogForwarder resource.

tests/golden/defaults/openshift4-logging/openshift4-logging/40_log_forwarder.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,5 @@ spec:
1717
- key: storagenode
1818
operator: Exists
1919
managementState: Managed
20-
pipelines:
21-
- inputRefs:
22-
- application
23-
name: application-logs
24-
outputRefs:
25-
- default
26-
- inputRefs:
27-
- infrastructure
28-
name: infrastructure-logs
29-
outputRefs:
30-
- default
3120
serviceAccount:
3221
name: logcollector

tests/golden/master/openshift4-logging/openshift4-logging/40_log_forwarder.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,12 @@ spec:
3131
- name: custom-forwarder
3232
type: syslog
3333
pipelines:
34-
- inputRefs:
35-
- application
36-
name: application-logs
34+
- name: application-logs
3735
outputRefs:
38-
- default
3936
- custom-forwarder
40-
- inputRefs:
41-
- audit
42-
name: audit-logs
37+
- name: audit-logs
4338
outputRefs:
4439
- custom-forwarder
45-
- inputRefs:
46-
- infrastructure
47-
name: infrastructure-logs
48-
outputRefs:
49-
- default
5040
- inputRefs:
5141
- my-apps
5242
name: my-apps

tests/golden/multilineerr/openshift4-logging/openshift4-logging/40_log_forwarder.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,7 @@ spec:
1919
managementState: Managed
2020
pipelines:
2121
- detectMultilineErrors: true
22-
inputRefs:
23-
- application
2422
name: application-logs
25-
outputRefs:
26-
- default
2723
parse: json
28-
- inputRefs:
29-
- infrastructure
30-
name: infrastructure-logs
31-
outputRefs:
32-
- default
3324
serviceAccount:
3425
name: logcollector

0 commit comments

Comments
 (0)