@@ -19,6 +19,7 @@ import (
1919 "github.com/pkg/errors"
2020
2121 "github.com/crunchydata/postgres-operator/internal/collector"
22+ "github.com/crunchydata/postgres-operator/internal/controller/postgrescluster"
2223 "github.com/crunchydata/postgres-operator/internal/feature"
2324 "github.com/crunchydata/postgres-operator/internal/initialize"
2425 "github.com/crunchydata/postgres-operator/internal/naming"
@@ -126,8 +127,9 @@ func statefulset(
126127
127128 pod (pgadmin , configmap , & sts .Spec .Template .Spec , dataVolume , oauthSecrets )
128129
129- if feature .Enabled (ctx , feature .OpenTelemetryLogs ) {
130+ if pgadmin . Spec . Instrumentation != nil && feature .Enabled (ctx , feature .OpenTelemetryLogs ) {
130131 // Logs for gunicorn and pgadmin write to /var/lib/pgadmin/logs
132+ // so the collector needs access to that that path.
131133 dataVolumeMount := corev1.VolumeMount {
132134 Name : "pgadmin-data" ,
133135 MountPath : "/var/lib/pgadmin" ,
@@ -137,9 +139,11 @@ func statefulset(
137139 }
138140
139141 collector .AddToPod (ctx , pgadmin .Spec .Instrumentation , pgadmin .Spec .ImagePullPolicy ,
140- configmap , & sts .Spec .Template .Spec , volumeMounts , "" , []string {}, false )
142+ configmap , & sts .Spec .Template .Spec , volumeMounts , "" , []string {LogDirectoryAbsolutePath }, false )
141143 }
142144
145+ postgrescluster .AddTMPEmptyDir (& sts .Spec .Template )
146+
143147 // Determine if a rollout is needed because Secrets and ConfigMaps have changed.
144148 // If the OAuth Secrets are changed, or if the OAUTH2_CONFIG changes in the
145149 // PGAdmin ConfigMap, then we need to restart the pgAdmin process and re-run
0 commit comments