Skip to content

Commit 6ffb9af

Browse files
Removed link, Added repo name to postgres image and print URLs to Grafana and Prometheus UI
Removed link, Added repo name to postgres image and print URLs to Grafana and Prometheus UI Signed-off-by: Alexandros Filios <[email protected]>
1 parent b53f202 commit 6ffb9af

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: integration/nwo/monitoring/monitoring/docker.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func (n *Extension) startPrometheus() {
134134
}
135135
}()
136136

137+
logger.Infof("Prometheus running on http://localhost:%s", port)
137138
}
138139

139140
func (n *Extension) startGrafana() {
@@ -162,7 +163,6 @@ func (n *Extension) startGrafana() {
162163
nat.Port(port + "/tcp"): struct{}{},
163164
},
164165
}, &container.HostConfig{
165-
Links: []string{n.platform.NetworkID() + "-prometheus"},
166166
Mounts: []mount.Mount{
167167
{
168168
Type: mount.TypeBind,
@@ -218,4 +218,5 @@ func (n *Extension) startGrafana() {
218218
dockerLogger.Debugf("%s", scanner.Text())
219219
}
220220
}()
221+
logger.Infof("Grafana running on http://localhost:%s with username: 'admin', password: 'admin'", port)
221222
}

Diff for: platform/view/services/db/driver/sql/postgres/test_utils.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
_ "modernc.org/sqlite"
2828
)
2929

30+
const PostgresImage = "postgres:latest"
31+
3032
type Logger interface {
3133
Log(...any)
3234
Errorf(string, ...any)
@@ -75,8 +77,9 @@ func ReadDataSource(s string) (*ContainerConfig, error) {
7577
if len(c.DBName) == 0 || c.Port == 0 || len(c.Pass) == 0 || len(c.User) == 0 {
7678
return nil, fmt.Errorf("incomplete datasource: %s", s)
7779
}
80+
7881
return &ContainerConfig{
79-
Image: "postgres:latest",
82+
Image: PostgresImage,
8083
Container: fmt.Sprintf("fsc-postgres-%s", c.DBName),
8184
Config: c,
8285
}, nil
@@ -101,7 +104,7 @@ func DefaultConfig(node string) *ContainerConfig {
101104

102105
func defaultConfigWithPort(node string, port int) *ContainerConfig {
103106
return &ContainerConfig{
104-
Image: "postgres:latest",
107+
Image: PostgresImage,
105108
Container: fmt.Sprintf("fsc-postgres-%s", node),
106109
Config: &Config{
107110
DBName: node,
@@ -251,7 +254,7 @@ func StartPostgres(t Logger, printLogs bool) (func(), string, error) {
251254
}
252255

253256
c := ContainerConfig{
254-
Image: getEnv("POSTGRES_IMAGE", "postgres:latest"),
257+
Image: getEnv("POSTGRES_IMAGE", PostgresImage),
255258
Container: getEnv("POSTGRES_CONTAINER", "fsc-postgres"),
256259
Config: &Config{
257260
DBName: getEnv("POSTGRES_DB", "testdb"),

0 commit comments

Comments
 (0)