Skip to content

Commit 77ed694

Browse files
committed
also fix for CL node container name
1 parent 96a4cca commit 77ed694

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

framework/components/clnode/clnode.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ import (
55
"context"
66
"errors"
77
"fmt"
8-
"github.com/docker/docker/api/types/container"
9-
"github.com/docker/go-connections/nat"
10-
"github.com/smartcontractkit/chainlink-testing-framework/framework"
11-
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/postgres"
12-
tc "github.com/testcontainers/testcontainers-go"
13-
"github.com/testcontainers/testcontainers-go/wait"
148
"os"
159
"path/filepath"
1610
"sync"
1711
"text/template"
1812
"time"
13+
14+
"github.com/docker/docker/api/types/container"
15+
"github.com/docker/go-connections/nat"
16+
tc "github.com/testcontainers/testcontainers-go"
17+
"github.com/testcontainers/testcontainers-go/wait"
18+
19+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
20+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/postgres"
1921
)
2022

2123
const (
22-
DefaultHTTPPort = "6688"
23-
DefaultP2PPort = "6690"
24+
DefaultHTTPPort = "6688"
25+
DefaultP2PPort = "6690"
26+
CLNodeContainerLabel = "clnode"
2427
)
2528

2629
var (
@@ -152,7 +155,7 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
152155
if in.Node.Name != "" {
153156
containerName = in.Node.Name
154157
} else {
155-
containerName = framework.DefaultTCName("node")
158+
containerName = framework.DefaultTCName(CLNodeContainerLabel)
156159
}
157160
customPorts := make([]string, 0)
158161
for _, p := range in.Node.CustomPorts {

framework/components/simple_node_set/node_set.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
const (
1818
DefaultHTTPPortStaticRangeStart = 10000
1919
DefaultP2PStaticRangeStart = 12000
20-
CLNodeDBContainerLabel = "clnode"
20+
CLNodeContainerLabel = "clnode"
2121
)
2222

2323
// Input is a node set configuration input
@@ -78,7 +78,7 @@ func printURLs(out *Output) {
7878

7979
func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
8080
in.DbInput.Databases = in.Nodes
81-
in.DbInput.Name = CLNodeDBContainerLabel
81+
in.DbInput.Name = CLNodeContainerLabel
8282
dbOut, err := postgres.NewPostgreSQL(in.DbInput)
8383
if err != nil {
8484
return nil, err
@@ -114,7 +114,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
114114
}
115115
}
116116
if in.NodeSpecs[overrideIdx].Node.Name == "" {
117-
nodeName = fmt.Sprintf("node%d", i)
117+
nodeName = fmt.Sprintf("%s%d", CLNodeContainerLabel, i)
118118
}
119119
eg.Go(func() error {
120120
var net string

framework/components/simple_node_set/reload.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
// UpgradeNodeSet updates nodes configuration TOML files
1313
// this API is discouraged, however, you can use it if nodes require restart or configuration updates, temporarily!
1414
func UpgradeNodeSet(in *Input, bc *blockchain.Output, wait time.Duration) (*Output, error) {
15-
clNodeDBContainerNameRegex := fmt.Sprintf("%s-%s.*", postgres.DBContainerLabel, CLNodeDBContainerLabel)
16-
_, err := chaos.ExecPumba(fmt.Sprintf("rm --volumes=false re2:node.*|%s", clNodeDBContainerNameRegex), wait)
15+
clNodeContainerNameRegex := fmt.Sprintf("%s.*", CLNodeContainerLabel)
16+
clNodeDBContainerNameRegex := fmt.Sprintf("%s-%s.*", postgres.DBContainerLabel, CLNodeContainerLabel)
17+
_, err := chaos.ExecPumba(fmt.Sprintf("rm --volumes=false re2:%s|%s", clNodeContainerNameRegex, clNodeDBContainerNameRegex), wait)
1718
if err != nil {
1819
return nil, err
1920
}

0 commit comments

Comments
 (0)