Skip to content

Commit

Permalink
name JD database differently
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Dec 11, 2024
1 parent d688ed8 commit c52f10d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/components/jd/jd.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func defaultJDDB() *postgres.Input {
return &postgres.Input{
Image: "postgres:12",
Port: 14000,
Name: "jd-db",
VolumeName: "jd",
JDDatabase: true,
}
Expand Down
8 changes: 7 additions & 1 deletion framework/components/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
type Input struct {
Image string `toml:"image" validate:"required"`
Port int `toml:"port"`
Name string `toml:"name"`
VolumeName string `toml:"volume_name"`
Databases int `toml:"databases"`
JDDatabase bool `toml:"jd_database"`
Expand All @@ -44,7 +45,12 @@ func NewPostgreSQL(in *Input) (*Output, error) {
ctx := context.Background()

bindPort := fmt.Sprintf("%s/tcp", Port)
containerName := framework.DefaultTCName("ns-postgresql")
var containerName string
if in.Name != "" {
containerName = framework.DefaultTCName(in.Name)
} else {
containerName = framework.DefaultTCName("ns-postgresql")
}

var sqlCommands []string
for i := 0; i <= in.Databases; i++ {
Expand Down

0 comments on commit c52f10d

Please sign in to comment.