We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5eae99f commit 96a4ccaCopy full SHA for 96a4cca
framework/components/postgres/postgres.go
@@ -9,6 +9,7 @@ import (
9
10
"github.com/docker/docker/api/types/container"
11
"github.com/docker/go-connections/nat"
12
+ "github.com/google/uuid"
13
"github.com/testcontainers/testcontainers-go"
14
tcwait "github.com/testcontainers/testcontainers-go/wait"
15
@@ -44,6 +45,9 @@ func NewPostgreSQL(in *Input) (*Output, error) {
44
45
ctx := context.Background()
46
47
bindPort := fmt.Sprintf("%s/tcp", Port)
48
+ if in.Name == "" {
49
+ in.Name = uuid.NewString()[0:5]
50
+ }
51
containerName := framework.DefaultTCName(fmt.Sprintf("%s-%s", DBContainerLabel, in.Name))
52
53
var sqlCommands []string
0 commit comments