Skip to content

Commit 4002fc2

Browse files
bearritobstrausser
and
bstrausser
authored
feat: Bump default postgres version (#2481)
* Bump default postgres version * Bump to use latest pg * Bump version from non-ancient version --------- Co-authored-by: bstrausser <bstrausser@locusrobotics.com>
1 parent b5f1e13 commit 4002fc2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

docs/modules/postgres.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When starting the Postgres container, you can pass options in a variadic way to
4141
#### Image
4242

4343
If you need to set a different Postgres Docker image, you can use `testcontainers.WithImage` with a valid Docker image
44-
for Postgres. E.g. `testcontainers.WithImage("docker.io/postgres:9.6")`.
44+
for Postgres. E.g. `testcontainers.WithImage("docker.io/postgres:16-alpine")`.
4545

4646
{% include "../features/common_functional_options.md" %}
4747

modules/postgres/examples_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func ExampleRunContainer() {
2121
dbPassword := "password"
2222

2323
postgresContainer, err := postgres.RunContainer(ctx,
24-
testcontainers.WithImage("docker.io/postgres:15.2-alpine"),
24+
testcontainers.WithImage("docker.io/postgres:16-alpine"),
2525
postgres.WithInitScripts(filepath.Join("testdata", "init-user-db.sh")),
2626
postgres.WithConfigFile(filepath.Join("testdata", "my-postgres.conf")),
2727
postgres.WithDatabase(dbName),

modules/postgres/postgres.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
const (
1414
defaultUser = "postgres"
1515
defaultPassword = "postgres"
16-
defaultPostgresImage = "docker.io/postgres:11-alpine"
16+
defaultPostgresImage = "docker.io/postgres:16-alpine"
1717
defaultSnapshotName = "migrated_template"
1818
)
1919

@@ -26,10 +26,9 @@ type PostgresContainer struct {
2626
snapshotName string
2727
}
2828

29-
3029
// MustConnectionString panics if the address cannot be determined.
3130
func (c *PostgresContainer) MustConnectionString(ctx context.Context, args ...string) string {
32-
addr, err := c.ConnectionString(ctx,args...)
31+
addr, err := c.ConnectionString(ctx, args...)
3332
if err != nil {
3433
panic(err)
3534
}

0 commit comments

Comments
 (0)