Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Bump default postgres version #2481

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ When starting the Postgres container, you can pass options in a variadic way to
#### Image

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

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

Expand Down
2 changes: 1 addition & 1 deletion modules/postgres/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func ExampleRunContainer() {
dbPassword := "password"

postgresContainer, err := postgres.RunContainer(ctx,
testcontainers.WithImage("docker.io/postgres:15.2-alpine"),
testcontainers.WithImage("docker.io/postgres:16-alpine"),
postgres.WithInitScripts(filepath.Join("testdata", "init-user-db.sh")),
postgres.WithConfigFile(filepath.Join("testdata", "my-postgres.conf")),
postgres.WithDatabase(dbName),
Expand Down
5 changes: 2 additions & 3 deletions modules/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
const (
defaultUser = "postgres"
defaultPassword = "postgres"
defaultPostgresImage = "docker.io/postgres:11-alpine"
defaultPostgresImage = "docker.io/postgres:16-alpine"
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
defaultSnapshotName = "migrated_template"
)

Expand All @@ -26,10 +26,9 @@ type PostgresContainer struct {
snapshotName string
}


// MustConnectionString panics if the address cannot be determined.
func (c *PostgresContainer) MustConnectionString(ctx context.Context, args ...string) string {
addr, err := c.ConnectionString(ctx,args...)
addr, err := c.ConnectionString(ctx, args...)
if err != nil {
panic(err)
}
Expand Down
Loading