@@ -37,7 +37,7 @@ const dumpKind = "pgdump"
37
37
// mysql and psql are a bit picky when it comes to localhost, use ip instead
38
38
const hostName = "127.0.0.1"
39
39
const dbDriver = "pgx"
40
- const pgImage = "docker.io/bitnami/postgresql:latest "
40
+ const pgImage = "docker.io/bitnami/postgresql:17 "
41
41
const plainKind = "plain"
42
42
43
43
type PGDumpAndRestoreTestSuite struct {
@@ -328,7 +328,14 @@ func pgDoBackup(
328
328
}
329
329
330
330
// create a brudi config for pgdump
331
- testPGConfig := createPGConfig (pgBackupTarget , useRestic , resticContainer .Address , resticContainer .Port , format , path )
331
+ testPGConfig := createPGConfig (
332
+ pgBackupTarget ,
333
+ useRestic ,
334
+ resticContainer .Address ,
335
+ resticContainer .Port ,
336
+ format ,
337
+ path ,
338
+ )
332
339
err = viper .ReadConfig (bytes .NewBuffer (testPGConfig ))
333
340
if err != nil {
334
341
return []testStruct {}, err
@@ -362,7 +369,14 @@ func pgDoRestore(
362
369
}()
363
370
364
371
// create a brudi configuration for pgrestore, depending on backup format
365
- restorePGConfig := createPGConfig (pgRestoreTarget , useRestic , resticContainer .Address , resticContainer .Port , format , path )
372
+ restorePGConfig := createPGConfig (
373
+ pgRestoreTarget ,
374
+ useRestic ,
375
+ resticContainer .Address ,
376
+ resticContainer .Port ,
377
+ format ,
378
+ path ,
379
+ )
366
380
err = viper .ReadConfig (bytes .NewBuffer (restorePGConfig ))
367
381
if err != nil {
368
382
return []testStruct {}, err
@@ -427,7 +441,11 @@ func pgDoRestore(
427
441
}
428
442
429
443
// createPGConfig creates a brudi config for the pgdump and the correct restoration command based on format
430
- func createPGConfig (container commons.TestContainerSetup , useRestic bool , resticIP , resticPort , format , path string ) []byte {
444
+ func createPGConfig (
445
+ container commons.TestContainerSetup ,
446
+ useRestic bool ,
447
+ resticIP , resticPort , format , path string ,
448
+ ) []byte {
431
449
var restoreConfig string
432
450
if format != plainKind {
433
451
restoreConfig = fmt .Sprintf (
@@ -513,7 +531,14 @@ func prepareTestData(database *sql.DB) ([]testStruct, error) {
513
531
testData := []testStruct {testStruct1 }
514
532
var insert * sql.Rows
515
533
for idx := range testData {
516
- insert , err = database .Query (fmt .Sprintf ("INSERT INTO %s (id, name) VALUES ( %d, '%s' )" , tableName , testData [idx ].ID , testData [idx ].Name ))
534
+ insert , err = database .Query (
535
+ fmt .Sprintf (
536
+ "INSERT INTO %s (id, name) VALUES ( %d, '%s' )" ,
537
+ tableName ,
538
+ testData [idx ].ID ,
539
+ testData [idx ].Name ,
540
+ ),
541
+ )
517
542
if err != nil {
518
543
return []testStruct {}, err
519
544
}
0 commit comments