Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5576b68
Implement code changes to enhance functionality and improve performance
tg123 Aug 29, 2025
1c101ce
chore: update version to 18.0 in version.json
tg123 Aug 29, 2025
fd3b5cc
fix: correct initialization of opblackList in PluralHelper
tg123 Aug 31, 2025
95c79ee
chore: update SDK version to 18.0 in README.md
tg123 Aug 31, 2025
413398e
Fixdocfx (#82)
tg123 Sep 2, 2025
1bdbe0b
refactor: update IKubernetes interface and template for consistency
tg123 Sep 2, 2025
ac6fdad
feat: add Microsoft.CodeAnalysis.CSharp package and improve source no…
tg123 Sep 2, 2025
d4b707b
chore: update package versions in Directory.Packages.props for compat…
tg123 Sep 2, 2025
2091984
chore: update Microsoft.VisualStudio.SlnGen and Nerdbank.GitVersionin…
tg123 Sep 2, 2025
65e688e
Merge branch 'kubernetes-client:master' into master
tg123 Sep 2, 2025
a899aca
Implement code changes to enhance functionality and improve performance
tg123 Aug 29, 2025
f892e88
chore: update version to 18.0 in version.json
tg123 Aug 29, 2025
412d093
fix: correct initialization of opblackList in PluralHelper
tg123 Aug 31, 2025
f1ce09a
chore: update SDK version to 18.0 in README.md
tg123 Aug 31, 2025
5506928
refactor: update IKubernetes interface and template for consistency
tg123 Sep 2, 2025
5a53d6f
feat: add Microsoft.CodeAnalysis.CSharp package and improve source no…
tg123 Sep 2, 2025
6b26209
chore: update package versions in Directory.Packages.props for compat…
tg123 Sep 2, 2025
b362267
chore: update Microsoft.VisualStudio.SlnGen and Nerdbank.GitVersionin…
tg123 Sep 2, 2025
50411fc
chore: downgrade xunit.runner.visualstudio and Xunit.StaFact package …
tg123 Sep 3, 2025
76f33b0
Merge branch 'gen1.34.0' of https://github.com/tg123/csharp into gen1…
tg123 Sep 3, 2025
535f93f
chore: update package versions in Directory.Packages.props for compat…
tg123 Sep 7, 2025
fc1eb5b
style: format code for consistency and readability
tg123 Sep 7, 2025
e3b5b88
feat: update certificate loading logic for .NET 9 compatibility
tg123 Sep 7, 2025
eb6f16b
fix: update certificate loading method for .NET 9 compatibility
tg123 Sep 7, 2025
c41906e
Merge branch 'kubernetes-client:master' into master
tg123 Sep 7, 2025
6e598d3
Merge remote-tracking branch 'origin/master' into gen1.34.0
tg123 Sep 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 26 additions & 25 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,52 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.1" />
<PackageVersion Include="FluentAssertions" Version="8.2.0" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="FluentAssertions" Version="8.6.0" />
<PackageVersion Include="Fractions" Version="7.3.0" />
<PackageVersion Include="JsonPatch.Net" Version="3.3.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.13.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.6.0" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.8" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.8" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.8" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.TestPlatform.ObjectModel" Version="17.14.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Nito.AsyncEx" Version="5.1.2" />
<PackageVersion Include="Nito.AsyncEx.Coordination" Version="5.1.2" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.11.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.11.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
<PackageVersion Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.2" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.1" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.4" />
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.14" />
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.4" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="9.0.4" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="9.0.8" />
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.15" />
<PackageVersion Include="System.Reactive" Version="6.0.2" />
<PackageVersion Include="System.Text.Json" Version="9.0.8" />
<PackageVersion Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" Version="16.3.0" />
<PackageVersion Include="Wiremock.Net" Version="1.7.4" />
<PackageVersion Include="Wiremock.Net" Version="1.12.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="Xunit.StaFact" Version="1.2.69" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Autofac" Version="8.2.1" />
<PackageVersion Include="Autofac" Version="8.4.0" />
<PackageVersion Include="CaseExtensions" Version="1.1.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.13.0" />
<PackageVersion Include="Namotion.Reflection" Version="3.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Namotion.Reflection" Version="3.4.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NJsonSchema" Version="11.2.0" />
<PackageVersion Include="NJsonSchema.Annotations" Version="11.2.0" />
<PackageVersion Include="NSwag.Core" Version="14.3.0" />
<PackageVersion Include="NJsonSchema" Version="11.4.0" />
<PackageVersion Include="NJsonSchema.Annotations" Version="11.4.0" />
<PackageVersion Include="NSwag.Core" Version="14.5.0" />
<PackageVersion Include="Scriban" Version="6.2.1" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="Microsoft.VisualStudio.SlnGen" Version="12.0.3" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.7.112" />
<GlobalPackageReference Include="Microsoft.VisualStudio.SlnGen" Version="12.0.23" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ ${GEN_DIR}/openapi/csharp.sh ${REPO_DIR}/src/KubernetesClient ${REPO_DIR}/csharp

| SDK Version | Kubernetes Version | .NET Targeting |
|-------------|--------------------|-----------------------------------------------------|
| 18.0 | 1.34 | net8.0;net9.0;net48*;netstandard2.0* |
| 17.0 | 1.33 | net8.0;net9.0;net48*;netstandard2.0* |
| 16.0 | 1.32 | net8.0;net9.0;net48*;netstandard2.0* |
| 15.0 | 1.31 | net6.0;net8.0;net48*;netstandard2.0* |
Expand Down
2 changes: 1 addition & 1 deletion csharp.settings
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export KUBERNETES_BRANCH=v1.33.0
export KUBERNETES_BRANCH=v1.34.0
export CLIENT_VERSION=0.0.1
export PACKAGE_NAME=k8s
2 changes: 1 addition & 1 deletion examples/clientset/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private static async Task Main(string[] args)
System.Console.WriteLine(item.Metadata.Name);
}

var pod = await clientSet.CoreV1.Pod.GetAsync("test","default").ConfigureAwait(false);
var pod = await clientSet.CoreV1.Pod.GetAsync("test", "default").ConfigureAwait(false);
System.Console.WriteLine(pod?.Metadata?.Name);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient/IKubernetes.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace k8s;

public partial interface IKubernetes : IBasicKubernetes, IDisposable
public partial interface IKubernetes : IDisposable
{
/// <summary>
/// The base URI of the service.
Expand Down
2 changes: 1 addition & 1 deletion src/LibKubernetesGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void Generate(OpenApiDocument swagger, IncrementalGeneratorPostInitializa
sc = scriptObjectFactory.CreateScriptObject();
sc.SetValue("groups", groups, true);

context.RenderToContext($"IBasicKubernetes.cs.template", sc, $"IBasicKubernetes.g.cs");
context.RenderToContext($"IKubernetes.cs.template", sc, $"IKubernetes.g.cs");
context.RenderToContext($"AbstractKubernetes.cs.template", sc, $"AbstractKubernetes.g.cs");
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/LibKubernetesGenerator/GeneratorExecutionContextExt.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.CSharp;
using Scriban;
using Scriban.Runtime;
using System.Text;
Expand All @@ -19,7 +20,10 @@ public static void RenderToContext(this IncrementalGeneratorPostInitializationCo
{
var template = Template.Parse(EmbedResource.GetResource(templatefile));
var generated = template.Render(tc);
context.AddSource(generatedfile, SourceText.From(generated, Encoding.UTF8));

var syntaxTree = CSharpSyntaxTree.ParseText(generated);
var normalized = syntaxTree.GetRoot().NormalizeWhitespace().ToFullString();
context.AddSource(generatedfile, SourceText.From(normalized, Encoding.UTF8));
}
}
}
1 change: 1 addition & 0 deletions src/LibKubernetesGenerator/LibKubernetesGenerator.target
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/LibKubernetesGenerator/PluralHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ internal class PluralHelper : IScriptObjectHelper
{
private readonly Dictionary<string, string> _classNameToPluralMap;
private readonly ClassNameHelper classNameHelper;
private readonly HashSet<string> opblackList = new HashSet<string>()
{
private readonly HashSet<string> opblackList =
[
"listClusterCustomObject",
"listNamespacedCustomObject",
};
"listCustomObjectForAllNamespaces",
];

public PluralHelper(ClassNameHelper classNameHelper, OpenApiDocument swagger)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace k8s;

/// <summary>
/// </summary>
public partial interface IBasicKubernetes
public partial interface IKubernetes
{
{{for group in groups}}
I{{group}}Operations {{group}} { get; }
Expand Down
Loading
Loading