Skip to content

Commit

Permalink
Ensure settings args are passed seperately e.g [-E, setting=value] vs…
Browse files Browse the repository at this point in the history
… [-E setting=value]
  • Loading branch information
Mpdreamz committed Dec 3, 2024
1 parent 80e74c0 commit da9ae70
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Argu" Version="6.0.0" />
<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="Proc" Version="0.9.0" />
<PackageReference Include="Proc" Version="0.9.1" />
<PackageReference Include="Fake.Tools.Git" Version="5.15.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion examples/ScratchPad/ScratchPad.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<IsPackable>False</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Proc" Version="0.9.0" />
<PackageReference Include="Proc" Version="0.9.1" />
<!--<ProjectReference Include="..\..\..\..\..\proc\src\Proc\Proc.csproj" />-->
<PackageReference Include="NEST" Version="6.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462</TargetFrameworks>
<Description>Provides an EphemeralCluster implementation that can download/bootstrap/run a throwaway customizable Elasticsearch cluster</Description>
<PackageTags>elastic,elasticsearch,cluster,ephemeral</PackageTags>
</PropertyGroup>
Expand Down
10 changes: 4 additions & 6 deletions src/Elastic.Elasticsearch.Managed/Configuration/NodeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ namespace Elastic.Elasticsearch.Managed.Configuration
{
public class NodeSettings : List<NodeSetting>
{
private static readonly ElasticVersion
LastVersionWithoutPrefixForSettings = ElasticVersion.From("5.0.0-alpha2");

public NodeSettings()
{
}
Expand All @@ -37,8 +34,7 @@ public void Add(string key, string value, string versionRange) =>

public string[] ToCommandLineArguments(ElasticVersion version)
{
var settingsPrefix = version > LastVersionWithoutPrefixForSettings ? "" : "es.";
var settingArgument = version.Major >= 5 ? "-E " : "-D";
var settingArgument = "-E";
return this
//if a node setting is only applicable for a certain version make sure its filtered out
.Where(s => string.IsNullOrEmpty(s.VersionRange) || version.InRange(s.VersionRange))
Expand All @@ -47,7 +43,9 @@ public string[] ToCommandLineArguments(ElasticVersion version)
//on the command with the latter taking precedence
.GroupBy(setting => setting.Key)
.Select(g => g.Last())
.Select(s => s.Key.StartsWith(settingArgument) ? s.ToString() : $"{settingArgument}{settingsPrefix}{s}")
.SelectMany<NodeSetting, string>(
s => [settingArgument, $"{s}"]
)
.ToArray();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462</TargetFrameworks>
<Description>
Provides an observable ElasticsearchNode abstraction that can be used to wrap an elasticsearch process.
Also ships with an cluster abstraction that can start one or more ElasticsearchNode's
</Description>
<PackageTags>elastic,elasticsearch,cluster,observable,rx</PackageTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Proc" Version="0.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Elastic.Stack.ArtifactsApi\Elastic.Stack.ArtifactsApi.csproj" />
<PackageReference Include="Proc" Version="0.9.1" />
</ItemGroup>
</Project>

0 comments on commit da9ae70

Please sign in to comment.