Skip to content

Commit

Permalink
add tmp method to update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Nov 7, 2024
1 parent c3de192 commit 2b57a8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 8 additions & 0 deletions framework/components/simple_node_set/reload.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package simple_node_set

// UpdateNodeConfigs updates nodes configuration TOML files
// this API is discouraged, however, you can use it if nodes require restart or configuration updates, temporarily!
func UpdateNodeConfigs(in *Input, cfg string) {
in.NodeSpecs[0].Node.UserConfigOverrides = in.NodeSpecs[0].Node.UserConfigOverrides + cfg
in.Out = nil
}
8 changes: 3 additions & 5 deletions framework/examples/myproject/reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ func TestReload(t *testing.T) {
// deploy second time
_, err = chaos.ExecPumba("rm --volumes=false re2:node.*|postgresql.*")
require.NoError(t, err)

in.NodeSet.NodeSpecs[0].Node.UserConfigOverrides = in.NodeSet.NodeSpecs[0].Node.UserConfigOverrides + `
ns.UpdateNodeConfigs(in.NodeSet, `
[Log]
Level = 'info'
`
in.NodeSet.Out = nil
level = 'info'
`)
out, err = ns.NewSharedDBNodeSet(in.NodeSet, bc, dp.BaseURLDocker)
require.NoError(t, err)
jobs, _, err := c[0].ReadJobs()
Expand Down

0 comments on commit 2b57a8a

Please sign in to comment.