From 497a48696c1314920f69f6687bf4e5aa004afeca Mon Sep 17 00:00:00 2001 From: E M <5089238+emizzle@users.noreply.github.com> Date: Fri, 29 May 2026 21:00:21 +1000 Subject: [PATCH] add --no-bootstrap-node option via WithNoBootstrapNodes() Follows the same pattern as --log-format / WithLogFormat(): - NoBootstrapNodes bool property on LogosStorageStartupConfig - WithNoBootstrapNodes() method on ILogosStorageSetup - Passes --no-bootstrap-node CLI flag in LogosStorageProcessRecipe - Sets STORAGE_NO_BOOTSTRAP_NODE=true env var in ContainerRecipe - Applied to bootstrap nodes in AutoBootstrapDistTest --- ProjectPlugins/StoragePlugin/ContainerRecipe.cs | 4 ++++ .../StoragePlugin/LogosStorageProcessRecipe.cs | 9 +++++++++ ProjectPlugins/StoragePlugin/LogosStorageSetup.cs | 7 +++++++ .../StoragePlugin/LogosStorageStartupConfig.cs | 1 + Tests/ExperimentalTests/AutoBootstrapDistTest.cs | 2 +- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ProjectPlugins/StoragePlugin/ContainerRecipe.cs b/ProjectPlugins/StoragePlugin/ContainerRecipe.cs index 2c8a897c..d8aae85c 100644 --- a/ProjectPlugins/StoragePlugin/ContainerRecipe.cs +++ b/ProjectPlugins/StoragePlugin/ContainerRecipe.cs @@ -67,6 +67,10 @@ namespace StoragePlugin { AddEnvVar("STORAGE_BOOTSTRAP_NODE", config.BootstrapSpr); } + if (config.NoBootstrapNodes) + { + AddEnvVar("STORAGE_NO_BOOTSTRAP_NODE", "true"); + } if (config.StorageQuota != null) { AddEnvVar("STORAGE_STORAGE_QUOTA", config.StorageQuota.SizeInBytes.ToString()!); diff --git a/ProjectPlugins/StoragePlugin/LogosStorageProcessRecipe.cs b/ProjectPlugins/StoragePlugin/LogosStorageProcessRecipe.cs index ec0da0b0..f4a48bee 100644 --- a/ProjectPlugins/StoragePlugin/LogosStorageProcessRecipe.cs +++ b/ProjectPlugins/StoragePlugin/LogosStorageProcessRecipe.cs @@ -72,6 +72,10 @@ namespace StoragePlugin { AddArg("--bootstrap-node", config.BootstrapSpr); } + if (config.NoBootstrapNodes) + { + AddArg("--no-bootstrap-node"); + } if (config.StorageQuota != null) { AddArg("--storage-quota", config.StorageQuota.SizeInBytes.ToString()!); @@ -121,5 +125,10 @@ namespace StoragePlugin { args.Add($"{arg}={val}"); } + + private void AddArg(string arg) + { + args.Add(arg); + } } } diff --git a/ProjectPlugins/StoragePlugin/LogosStorageSetup.cs b/ProjectPlugins/StoragePlugin/LogosStorageSetup.cs index 5c1d9eac..98c9d189 100644 --- a/ProjectPlugins/StoragePlugin/LogosStorageSetup.cs +++ b/ProjectPlugins/StoragePlugin/LogosStorageSetup.cs @@ -12,6 +12,7 @@ namespace StoragePlugin ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level); ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level, LogosStorageLogCustomTopics customTopics); ILogosStorageSetup WithLogFormat(LogosStorageLogFormat format); + ILogosStorageSetup WithNoBootstrapNodes(); ILogosStorageSetup WithStorageQuota(ByteSize storageQuota); ILogosStorageSetup WithBlockTTL(TimeSpan duration); ILogosStorageSetup WithBlockMaintenanceInterval(TimeSpan duration); @@ -89,6 +90,12 @@ namespace StoragePlugin return this; } + public ILogosStorageSetup WithNoBootstrapNodes() + { + NoBootstrapNodes = true; + return this; + } + public ILogosStorageSetup WithStorageQuota(ByteSize storageQuota) { StorageQuota = storageQuota; diff --git a/ProjectPlugins/StoragePlugin/LogosStorageStartupConfig.cs b/ProjectPlugins/StoragePlugin/LogosStorageStartupConfig.cs index 24dbf018..a496cc13 100644 --- a/ProjectPlugins/StoragePlugin/LogosStorageStartupConfig.cs +++ b/ProjectPlugins/StoragePlugin/LogosStorageStartupConfig.cs @@ -13,6 +13,7 @@ namespace StoragePlugin public LogosStorageLogCustomTopics? CustomTopics { get; set; } = new LogosStorageLogCustomTopics(LogosStorageLogLevel.Info, LogosStorageLogLevel.Warn); public ByteSize? StorageQuota { get; set; } public bool MetricsEnabled { get; set; } + public bool NoBootstrapNodes { get; set; } public string? BootstrapSpr { get; set; } public int? BlockTTL { get; set; } public bool? EnableValidator { get; set; } diff --git a/Tests/ExperimentalTests/AutoBootstrapDistTest.cs b/Tests/ExperimentalTests/AutoBootstrapDistTest.cs index f87a5b9d..039ff7f2 100644 --- a/Tests/ExperimentalTests/AutoBootstrapDistTest.cs +++ b/Tests/ExperimentalTests/AutoBootstrapDistTest.cs @@ -14,7 +14,7 @@ namespace LogosStorageTests public void SetupBootstrapNode() { isBooting = true; - BootstrapNode = StartLogosStorage(s => s.WithName("BOOTSTRAP_" + GetTestNamespace()).WithLogFormat(LogosStorageLogFormat.Json)); + BootstrapNode = StartLogosStorage(s => s.WithName("BOOTSTRAP_" + GetTestNamespace()).WithLogFormat(LogosStorageLogFormat.Json).WithNoBootstrapNodes()); isBooting = false; }