From 8eb22e7640ce418eb00320b598da8de1265e022e Mon Sep 17 00:00:00 2001 From: Andy Pliszka Date: Mon, 17 Jun 2024 17:03:54 -0400 Subject: [PATCH] feat bootstrap fixes (#424) * fix: config-merge only if config.toml or app.toml exist * fix: select node container for image check --- cmd/versioncheck.go | 7 ++++++- internal/fullnode/pod_builder.go | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cmd/versioncheck.go b/cmd/versioncheck.go index b642b84d..0cb23bd9 100644 --- a/cmd/versioncheck.go +++ b/cmd/versioncheck.go @@ -174,7 +174,12 @@ func checkVersion( image = v.Image } - thisPodImage := thisPod.Spec.Containers[0].Image + var thisPodImage string + for _, c := range thisPod.Spec.Containers { + if c.Name == "node" { + thisPodImage = c.Image + } + } if thisPodImage != image { return fmt.Errorf("image mismatch for height %d: %s != %s", height, thisPodImage, image) } diff --git a/internal/fullnode/pod_builder.go b/internal/fullnode/pod_builder.go index 2c81a011..1112e1d3 100644 --- a/internal/fullnode/pod_builder.go +++ b/internal/fullnode/pod_builder.go @@ -425,8 +425,13 @@ rm -rf "$CONFIG_DIR/node_key.json" echo "Merging config..." set -x -config-merge -f toml "$TMP_DIR/config.toml" "$OVERLAY_DIR/config-overlay.toml" > "$CONFIG_DIR/config.toml" -config-merge -f toml "$TMP_DIR/app.toml" "$OVERLAY_DIR/app-overlay.toml" > "$CONFIG_DIR/app.toml" + +if [ -f "$TMP_DIR/config.toml" ]; then + config-merge -f toml "$TMP_DIR/config.toml" "$OVERLAY_DIR/config-overlay.toml" > "$CONFIG_DIR/config.toml" +fi +if [ -f "$TMP_DIR/app.toml" ]; then + config-merge -f toml "$TMP_DIR/app.toml" "$OVERLAY_DIR/app-overlay.toml" > "$CONFIG_DIR/app.toml" +fi `, }, Env: env,