File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ func defaultJDDB() *postgres.Input {
5454 return & postgres.Input {
5555 Image : "postgres:12" ,
5656 Port : 14000 ,
57+ Name : "jd-db" ,
5758 VolumeName : "jd" ,
5859 JDDatabase : true ,
5960 }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ const (
2525type Input struct {
2626 Image string `toml:"image" validate:"required"`
2727 Port int `toml:"port"`
28+ Name string `toml:"name"`
2829 VolumeName string `toml:"volume_name"`
2930 Databases int `toml:"databases"`
3031 JDDatabase bool `toml:"jd_database"`
@@ -44,7 +45,12 @@ func NewPostgreSQL(in *Input) (*Output, error) {
4445 ctx := context .Background ()
4546
4647 bindPort := fmt .Sprintf ("%s/tcp" , Port )
47- containerName := framework .DefaultTCName ("ns-postgresql" )
48+ var containerName string
49+ if in .Name != "" {
50+ containerName = framework .DefaultTCName (in .Name )
51+ } else {
52+ containerName = framework .DefaultTCName ("ns-postgresql" )
53+ }
4854
4955 var sqlCommands []string
5056 for i := 0 ; i <= in .Databases ; i ++ {
You can’t perform that action at this time.
0 commit comments