diff --git a/src/ApiService/ApiService/FeatureFlags.cs b/src/ApiService/ApiService/FeatureFlags.cs index a55a3dad19..97fdfcad1c 100644 --- a/src/ApiService/ApiService/FeatureFlags.cs +++ b/src/ApiService/ApiService/FeatureFlags.cs @@ -2,4 +2,5 @@ public static class FeatureFlagConstants { public const string EnableScribanOnly = "EnableScribanOnly"; + public const string EnableNodeDecommissionStrategy = "EnableNodeDecommissionStrategy"; } diff --git a/src/ApiService/ApiService/ServiceConfiguration.cs b/src/ApiService/ApiService/ServiceConfiguration.cs index 9b50c53f23..fb0a308481 100644 --- a/src/ApiService/ApiService/ServiceConfiguration.cs +++ b/src/ApiService/ApiService/ServiceConfiguration.cs @@ -38,8 +38,6 @@ public interface IServiceConfig { public string? OneFuzzMonitor { get; } public string? OneFuzzOwner { get; } - public string OneFuzzNodeDisposalStrategy { get; } - public string? OneFuzzResourceGroup { get; } public string? OneFuzzTelemetry { get; } @@ -135,8 +133,6 @@ public string OneFuzzVersion { } public string? OneFuzzAllowOutdatedAgent => GetEnv("ONEFUZZ_ALLOW_OUTDATED_AGENT"); - - public string OneFuzzNodeDisposalStrategy { get => GetEnv("ONEFUZZ_NODE_DISPOSAL_STRATEGY") ?? "scale_in"; } public string OneFuzzStoragePrefix => ""; // in production we never prefix the tables public Uri OneFuzzBaseAddress { diff --git a/src/ApiService/ApiService/onefuzzlib/ScalesetOperations.cs b/src/ApiService/ApiService/onefuzzlib/ScalesetOperations.cs index 3c54e7de9e..ed268c4b6e 100644 --- a/src/ApiService/ApiService/onefuzzlib/ScalesetOperations.cs +++ b/src/ApiService/ApiService/onefuzzlib/ScalesetOperations.cs @@ -608,11 +608,7 @@ where x.State.ReadyForReset() } // Perform operations until they fail due to scaleset getting locked: - var strategy = _context.ServiceConfiguration.OneFuzzNodeDisposalStrategy.ToLowerInvariant() switch { - // allowing typo’d or correct name for config setting: - "decomission" or "decommission" => NodeDisposalStrategy.Decommission, - _ => NodeDisposalStrategy.ScaleIn, - }; + var strategy = await _context.FeatureManagerSnapshot.IsEnabledAsync(FeatureFlagConstants.EnableNodeDecommissionStrategy) ? NodeDisposalStrategy.Decommission : NodeDisposalStrategy.ScaleIn; var reimageNodes = await ReimageNodes(scaleSet, toReimage.Values, strategy); if (!reimageNodes.IsOk) { diff --git a/src/ApiService/IntegrationTests/Fakes/TestServiceConfiguration.cs b/src/ApiService/IntegrationTests/Fakes/TestServiceConfiguration.cs index eb6d487e8e..725675b37e 100644 --- a/src/ApiService/IntegrationTests/Fakes/TestServiceConfiguration.cs +++ b/src/ApiService/IntegrationTests/Fakes/TestServiceConfiguration.cs @@ -58,8 +58,6 @@ public TestServiceConfiguration(string tablePrefix) { public string? OneFuzzOwner => throw new System.NotImplementedException(); - public string OneFuzzNodeDisposalStrategy => throw new System.NotImplementedException(); - public ResourceIdentifier? OneFuzzDataStorage => throw new NotImplementedException(); public string? OneFuzzResourceGroup => throw new NotImplementedException();