add KubernetesClient.Aot to support Aot (#1498)
* init aot * fix ca2007 * xUnit1031 * fix ca2007 * fix ca2007 * remove deprecated ctor * fix xUnit1031 * fix missing doc * fix missing dispose * wait for warnings fix * fix space * move aot code to dedicated proj * Remove commented out code * eliminate know warnings * add e2e test for aot * rever on field convert annotation * add e2e aot gh * Add KubernetesClient.Aot project reference * move CA1812 rule violation to file
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\src\KubernetesClient\KubernetesClient.csproj" />
|
||||
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\src\KubernetesClient\KubernetesClient.csproj" Condition="'$(PublishAot)' != 'true'" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
16
examples/aot/Program.cs
Normal file
16
examples/aot/Program.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using k8s;
|
||||
|
||||
var config = KubernetesClientConfiguration.BuildDefaultConfig();
|
||||
IKubernetes client = new Kubernetes(config);
|
||||
Console.WriteLine("Starting Request!");
|
||||
|
||||
var list = client.CoreV1.ListNamespacedPod("default");
|
||||
foreach (var item in list.Items)
|
||||
{
|
||||
Console.WriteLine(item.Metadata.Name);
|
||||
}
|
||||
|
||||
if (list.Items.Count == 0)
|
||||
{
|
||||
Console.WriteLine("Empty!");
|
||||
}
|
||||
11
examples/aot/aot.csproj
Normal file
11
examples/aot/aot.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishAot>true</PublishAot>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\KubernetesClient.Aot\KubernetesClient.Aot.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user