Skip to content

Commit efb50b8

Browse files
committed
Small changes
1 parent 5ec822e commit efb50b8

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

internal/collector/postgres.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ func EnablePostgresLogging(
245245
}
246246

247247
// pgBackRest pipeline
248-
pgbackrestLogPath := util.GetPGBackRestLogPathForInstance(inCluster)
248+
pgBackRestLogPath := util.GetPGBackRestLogPathForInstance(inCluster)
249249
outConfig.Extensions["file_storage/pgbackrest_logs"] = map[string]any{
250-
"directory": pgbackrestLogPath + "/receiver",
250+
"directory": pgBackRestLogPath + "/receiver",
251251
"create_directory": false,
252252
"fsync": true,
253253
}
@@ -260,8 +260,8 @@ func EnablePostgresLogging(
260260
// a log record or two to the old file while rotation is occurring.
261261
// The collector knows not to create duplicate logs.
262262
"include": []string{
263-
pgbackrestLogPath + "/*.log",
264-
pgbackrestLogPath + "/*.log.1",
263+
pgBackRestLogPath + "/*.log",
264+
pgBackRestLogPath + "/*.log.1",
265265
},
266266
"storage": "file_storage/pgbackrest_logs",
267267

internal/controller/postgrescluster/pgbackrest_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,8 +3125,7 @@ volumes:
31253125
name: tmp
31263126
- name: volumes-stuff
31273127
persistentVolumeClaim:
3128-
claimName: additional-pvc
3129-
`))
3128+
claimName: additional-pvc`))
31303129

31313130
// No events created
31323131
assert.Equal(t, len(recorder.Events), 0)

internal/pgbackrest/config.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
123123
serverConfig(postgresCluster).String()
124124

125125
if RepoHostVolumeDefined(postgresCluster) && repoHostName != "" {
126+
// Get pgbackrest log path for repo host pod
126127
pgBackRestLogPath := generateRepoHostLogPath(postgresCluster)
127128

128129
cm.Data[CMRepoKey] = iniGeneratedWarning +
@@ -137,8 +138,6 @@ func CreatePGBackRestConfigMapIntent(ctx context.Context, postgresCluster *v1bet
137138
).String()
138139

139140
if collector.OpenTelemetryLogsOrMetricsEnabled(ctx, postgresCluster) {
140-
// Get pgbackrest log path for repo host pod
141-
142141
err = collector.AddToConfigMap(ctx, collector.NewConfigForPgBackrestRepoHostPod(
143142
ctx,
144143
postgresCluster.Spec.Instrumentation,
@@ -373,7 +372,7 @@ func populatePGInstanceConfigurationMap(
373372
serviceName, serviceNamespace, repoHostName, pgdataDir,
374373
fetchKeyCommand, postgresVersion string,
375374
pgPort int32, repos []v1beta1.PGBackRestRepo,
376-
globalConfig map[string]string, pgbackrestLogPath string,
375+
globalConfig map[string]string, pgBackRestLogPath string,
377376
) iniSectionSet {
378377

379378
// TODO(cbandy): pass a FQDN in already.
@@ -389,7 +388,7 @@ func populatePGInstanceConfigurationMap(
389388
// pgBackRest spool-path should always be co-located with the Postgres WAL path.
390389
global.Set("spool-path", "/pgdata/pgbackrest-spool")
391390
// pgBackRest will log to the pgData volume for commands run on the PostgreSQL instance
392-
global.Set("log-path", pgbackrestLogPath)
391+
global.Set("log-path", pgBackRestLogPath)
393392

394393
for _, repo := range repos {
395394
global.Set(repo.Name+"-path", defaultRepo1Path+repo.Name)

0 commit comments

Comments
 (0)