File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ func TestDockerNodeWithSharedDB(t *testing.T) {
3333 input : & clnode.Input {
3434 DataProviderURL : "http://example.com" ,
3535 DbInput : & postgres.Input {
36- Image : "postgres:15.6" ,
36+ Image : "postgres:15.6" ,
37+ Port : "16000" ,
38+ VolumeName : "a" ,
3739 },
3840 Node : & clnode.NodeInput {
3941 Image : "public.ecr.aws/chainlink/chainlink:v2.17.0" ,
@@ -67,7 +69,9 @@ func TestDockerNodeWithDB(t *testing.T) {
6769 input : & clnode.Input {
6870 DataProviderURL : "http://example.com" ,
6971 DbInput : & postgres.Input {
70- Image : "postgres:15.6" ,
72+ Image : "postgres:15.6" ,
73+ Port : "15000" ,
74+ VolumeName : "b" ,
7175 },
7276 Node : & clnode.NodeInput {
7377 Image : "public.ecr.aws/chainlink/chainlink:v2.17.0" ,
Original file line number Diff line number Diff line change @@ -19,15 +19,16 @@ const (
1919 Port = "5432"
2020 ExposedStaticPort = "13000"
2121 Database = "chainlink"
22- DatabaseDir = "postgresql_data"
22+ DBVolumeName = "postgresql_data"
2323)
2424
2525type Input struct {
26- Image string `toml:"image" validate:"required"`
27- Port string `toml:"port"`
28- Databases int `toml:"databases"`
29- PullImage bool `toml:"pull_image"`
30- Out * Output `toml:"out"`
26+ Image string `toml:"image" validate:"required"`
27+ Port string `toml:"port"`
28+ VolumeName string `toml:"volume_name"`
29+ Databases int `toml:"databases"`
30+ PullImage bool `toml:"pull_image"`
31+ Out * Output `toml:"out"`
3132}
3233
3334type Output struct {
@@ -86,7 +87,7 @@ func NewPostgreSQL(in *Input) (*Output, error) {
8687 Mounts : testcontainers.ContainerMounts {
8788 {
8889 Source : testcontainers.GenericVolumeMountSource {
89- Name : DatabaseDir ,
90+ Name : fmt . Sprintf ( "%s%s" , DBVolumeName , in . VolumeName ) ,
9091 },
9192 Target : "/var/lib/postgresql/data" ,
9293 },
You can’t perform that action at this time.
0 commit comments