Skip to content

Commit 9dab51e

Browse files
committed
Don't add collector to pod without instrumentation
1 parent d4243b0 commit 9dab51e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/controller/postgrescluster/pgbackrest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ func (r *Reconciler) generateRepoHostIntent(ctx context.Context, postgresCluster
694694

695695
// If OpenTelemetryLogs is enabled, we want to add the collector to the pod
696696
// and also add the RepoVolumes to the container.
697-
if feature.Enabled(ctx, feature.OpenTelemetryLogs) {
697+
if postgresCluster.Spec.Instrumentation != nil && feature.Enabled(ctx, feature.OpenTelemetryLogs) {
698698
collector.AddToPod(ctx, postgresCluster.Spec.Instrumentation, postgresCluster.Spec.ImagePullPolicy,
699699
&corev1.ConfigMap{ObjectMeta: naming.PGBackRestConfig(postgresCluster)},
700700
&repo.Spec.Template.Spec, []corev1.VolumeMount{}, "", pgBackRestLogPath, true)

0 commit comments

Comments
 (0)