Skip to content

Commit

Permalink
move chain-id flag after init, required for some chains
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Nov 17, 2023
1 parent 573d4ec commit 246877e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/fullnode/pod_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func initContainers(crd *cosmosv1.CosmosFullNode, moniker string) []corev1.Conta
addrbookCmd, addrbookArgs := DownloadAddrbookCommand(crd.Spec.ChainSpec)
env := envVars(crd)

initCmd := fmt.Sprintf("%s --chain-id %s init %s", binary, crd.Spec.ChainSpec.ChainID, moniker)
initCmd := fmt.Sprintf("%s init --chain-id %s %s", binary, crd.Spec.ChainSpec.ChainID, moniker)
if len(crd.Spec.ChainSpec.AdditionalInitArgs) > 0 {
initCmd += " " + strings.Join(crd.Spec.ChainSpec.AdditionalInitArgs, " ")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/fullnode/pod_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ func TestPodBuilder(t *testing.T) {
require.Contains(t, freshCont.Args[1], `rm -rf "$HOME/.tmp/*"`)

initCont := pod.Spec.InitContainers[1]
require.Contains(t, initCont.Args[1], `osmosisd --chain-id osmosis-123 init osmosis-6 --home "$CHAIN_HOME"`)
require.Contains(t, initCont.Args[1], `osmosisd --chain-id osmosis-123 init osmosis-6 --home "$HOME/.tmp"`)
require.Contains(t, initCont.Args[1], `osmosisd init --chain-id osmosis-123 osmosis-6 --home "$CHAIN_HOME"`)
require.Contains(t, initCont.Args[1], `osmosisd init --chain-id osmosis-123 osmosis-6 --home "$HOME/.tmp"`)

mergeConfig1 := pod.Spec.InitContainers[3]
// The order of config-merge arguments is important. Rightmost takes precedence.
Expand Down

0 comments on commit 246877e

Please sign in to comment.