Skip to content

Commit 054dbff

Browse files
committed
Change logic to includeLogrotate
Only logrotate if - boolean is true and - OTel log gate is on
1 parent 2eb7e67 commit 054dbff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/collector/instance.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func AddToPod(
5454
return
5555
}
5656

57+
// We only want to include log rotation if this type of pod requires it
58+
// (indicate by the includeLogrotate boolean) AND if logging is enabled
59+
// for this PostgresCluster/PGAdmin
60+
includeLogrotate = includeLogrotate && OpenTelemetryLogsEnabled(ctx, spec)
61+
5762
// Create volume and volume mount for otel collector config
5863
configVolumeMount := corev1.VolumeMount{
5964
Name: "collector-config",
@@ -152,7 +157,6 @@ func AddToPod(
152157
Key: "logrotate.conf",
153158
Path: "logrotate.conf",
154159
}},
155-
Optional: initialize.Bool(true),
156160
},
157161
}},
158162
}

0 commit comments

Comments
 (0)