Skip to content

Commit 3ad40f1

Browse files
authored
Expose a function that is used to name containers in simple node set (#2083)
1 parent b393ad4 commit 3ad40f1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

framework/.changeset/v0.10.17.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Expose a function that is used to name containers in simple node set

framework/components/simple_node_set/node_set.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ func NewSharedDBNodeSet(in *Input, bcOut *blockchain.Output) (*Output, error) {
6565
return out, nil
6666
}
6767

68+
func NodeNamePrefix(nodeSetName string) string {
69+
return nodeSetName + "-" + "node"
70+
}
71+
6872
func printURLs(out *Output) {
6973
if out == nil {
7074
return
@@ -113,7 +117,6 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
113117
mu := &sync.Mutex{}
114118
for i := 0; i < in.Nodes; i++ {
115119
overrideIdx := i
116-
var nodeName string
117120
if in.OverrideMode == "all" {
118121
if len(in.NodeSpecs[overrideIdx].Node.CustomPorts) > 0 {
119122
return nil, fmt.Errorf("custom_ports can be used only with override_mode = 'each'")
@@ -132,8 +135,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output) (*Output, error) {
132135
if in.NodeSpecs[overrideIdx].Node.TestConfigOverrides != "" {
133136
net = in.NodeSpecs[overrideIdx].Node.TestConfigOverrides
134137
}
135-
nodeName = fmt.Sprintf("node%d", i)
136-
nodeWithNodeSetPrefixName := fmt.Sprintf("%s-%s", in.Name, nodeName)
138+
nodeWithNodeSetPrefixName := NodeNamePrefix(in.Name) + fmt.Sprint(i)
137139

138140
nodeSpec := &clnode.Input{
139141
NoDNS: in.NoDNS,

0 commit comments

Comments
 (0)