@@ -142,6 +142,10 @@ func TestPod(t *testing.T) {
142142 t .Parallel ()
143143
144144 features := feature .NewGate ()
145+ assert .NilError (t , features .SetFromMap (map [string ]bool {
146+ feature .OpenTelemetryLogs : true ,
147+ feature .OpenTelemetryMetrics : true ,
148+ }))
145149 ctx := feature .NewContext (context .Background (), features )
146150
147151 cluster := new (v1beta1.PostgresCluster )
@@ -386,12 +390,6 @@ volumes:
386390 })
387391
388392 t .Run ("WithOtelNoLogSet" , func (t * testing.T ) {
389- featuresWithOtel := feature .NewGate ()
390- assert .NilError (t , featuresWithOtel .SetFromMap (map [string ]bool {
391- feature .OpenTelemetryLogs : true ,
392- feature .OpenTelemetryMetrics : true ,
393- }))
394- ctx = feature .NewContext (context .Background (), featuresWithOtel )
395393 cluster .Spec .Instrumentation = & v1beta1.InstrumentationSpec {}
396394 logfile = "/tmp/pgbouncer.log"
397395
@@ -431,6 +429,44 @@ containers:
431429 - mountPath: /etc/pgbouncer
432430 name: pgbouncer-config
433431 readOnly: true
432+ - command:
433+ - bash
434+ - -ceu
435+ - --
436+ - |-
437+ monitor() {
438+ exec {fd}<> <(:||:)
439+ while read -r -t 5 -u "${fd}" ||:; do
440+ if [[ "${directory}" -nt "/proc/self/fd/${fd}" ]] && pkill -HUP --exact pgbouncer
441+ then
442+ exec {fd}>&- && exec {fd}<> <(:||:)
443+ stat --format='Loaded configuration dated %y' "${directory}"
444+ fi
445+ done
446+ }; export directory="$1"; export -f monitor; exec -a "$0" bash -ceu monitor
447+ - pgbouncer-config
448+ - /etc/pgbouncer
449+ image: image-town
450+ imagePullPolicy: Always
451+ name: pgbouncer-config
452+ resources:
453+ limits:
454+ cpu: 5m
455+ memory: 16Mi
456+ securityContext:
457+ allowPrivilegeEscalation: false
458+ capabilities:
459+ drop:
460+ - ALL
461+ privileged: false
462+ readOnlyRootFilesystem: true
463+ runAsNonRoot: true
464+ seccompProfile:
465+ type: RuntimeDefault
466+ volumeMounts:
467+ - mountPath: /etc/pgbouncer
468+ name: pgbouncer-config
469+ readOnly: true
434470- command:
435471 - bash
436472 - -ceu
@@ -484,44 +520,6 @@ containers:
484520 - mountPath: /etc/logrotate.d
485521 name: logrotate-config
486522 readOnly: true
487- - command:
488- - bash
489- - -ceu
490- - --
491- - |-
492- monitor() {
493- exec {fd}<> <(:||:)
494- while read -r -t 5 -u "${fd}" ||:; do
495- if [[ "${directory}" -nt "/proc/self/fd/${fd}" ]] && pkill -HUP --exact pgbouncer
496- then
497- exec {fd}>&- && exec {fd}<> <(:||:)
498- stat --format='Loaded configuration dated %y' "${directory}"
499- fi
500- done
501- }; export directory="$1"; export -f monitor; exec -a "$0" bash -ceu monitor
502- - pgbouncer-config
503- - /etc/pgbouncer
504- image: image-town
505- imagePullPolicy: Always
506- name: pgbouncer-config
507- resources:
508- limits:
509- cpu: 5m
510- memory: 16Mi
511- securityContext:
512- allowPrivilegeEscalation: false
513- capabilities:
514- drop:
515- - ALL
516- privileged: false
517- readOnlyRootFilesystem: true
518- runAsNonRoot: true
519- seccompProfile:
520- type: RuntimeDefault
521- volumeMounts:
522- - mountPath: /etc/pgbouncer
523- name: pgbouncer-config
524- readOnly: true
525523volumes:
526524- name: pgbouncer-config
527525 projected:
@@ -549,6 +547,20 @@ volumes:
549547 items:
550548 - key: ca.crt
551549 path: ~postgres-operator/backend-ca.crt
550+ - name: logrotate-config
551+ projected:
552+ sources:
553+ - configMap:
554+ items:
555+ - key: logrotate.conf
556+ path: logrotate.conf
557+ - name: collector-config
558+ projected:
559+ sources:
560+ - configMap:
561+ items:
562+ - key: collector.yaml
563+ path: config.yaml
552564 ` ))
553565 })
554566
0 commit comments