From fc173c9d218270541a145bd9d0697a22c4abb5f0 Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Fri, 17 Nov 2023 09:57:35 -0700 Subject: [PATCH] move chain-id flag after init, required for some chains (#391) --- internal/fullnode/pod_builder.go | 2 +- internal/fullnode/pod_builder_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/fullnode/pod_builder.go b/internal/fullnode/pod_builder.go index 73c85c37..2d95ccfc 100644 --- a/internal/fullnode/pod_builder.go +++ b/internal/fullnode/pod_builder.go @@ -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, " ") } diff --git a/internal/fullnode/pod_builder_test.go b/internal/fullnode/pod_builder_test.go index bd6f62e6..bf9285ed 100644 --- a/internal/fullnode/pod_builder_test.go +++ b/internal/fullnode/pod_builder_test.go @@ -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.