Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/controller/postgrescluster/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,10 +1220,12 @@ func (r *Reconciler) reconcileInstance(

// For now, we are not using logrotate to rotate postgres or patroni logs,
// but we are using it for pgbackrest logs in the postgres pod, so we will
// set includeLogrotate to true, but only if backups are enabled.
// set includeLogrotate to true, but only if backups are enabled
// and local volumes are available.
includeLogrotate := backupsSpecFound && pgbackrest.RepoHostVolumeDefined(cluster)
collector.AddToPod(ctx, cluster.Spec.Instrumentation, cluster.Spec.ImagePullPolicy, instanceConfigMap, &instance.Spec.Template,
[]corev1.VolumeMount{postgres.DataVolumeMount()}, pgPassword,
[]string{naming.PGBackRestPGDataLogPath}, backupsSpecFound, true)
[]string{naming.PGBackRestPGDataLogPath}, includeLogrotate, true)
}

// Add postgres-exporter to the instance Pod spec
Expand Down
Loading