netstandard2 extendable lib model, basic rest (#793)
* first lib model * add missing files * happy test * add vanilla rest for extend * fix new url pattern * address comments * add v to tag * bump ver * add missing file when ren * support multi pkg * fix gh action * fix env var * ren title * use gh action to set ver * remove unused * remove unused
This commit is contained in:
10
.github/workflows/draft.yaml
vendored
10
.github/workflows/draft.yaml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Nuget
|
||||
name: Draft Release
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -35,13 +35,13 @@ jobs:
|
||||
- name: dotnet test
|
||||
run: dotnet test
|
||||
|
||||
- name: dotnet pack
|
||||
run: dotnet pack -c Release src/KubernetesClient -o pkg --include-symbols
|
||||
- uses: dotnet/nbgv@master
|
||||
with:
|
||||
setAllVars: true
|
||||
|
||||
- name: create release
|
||||
shell: pwsh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
$VERSION = Get-ChildItem -Path pkg/*.nupkg -Name | Select-String -Pattern '\d+.\d+.\d+' | foreach {$_.Matches.Value}
|
||||
gh release create -d --generate-notes v$VERSION
|
||||
gh release create -d --generate-notes v$env:NBGV_NuGetPackageVersion
|
||||
2
.github/workflows/nuget.yaml
vendored
2
.github/workflows/nuget.yaml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
run: dotnet test
|
||||
|
||||
- name: dotnet pack
|
||||
run: dotnet pack -c Release src/KubernetesClient -o pkg --include-symbols
|
||||
run: dotnet pack -c Release src/nuget.proj -o pkg --include-symbols
|
||||
|
||||
- name: dotnet nuget push
|
||||
run: dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }}
|
||||
|
||||
@@ -5,4 +5,35 @@
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Authors>The Kubernetes Project Authors</Authors>
|
||||
<Copyright>2017 The Kubernetes Project Authors</Copyright>
|
||||
<Description>Client library for the Kubernetes open source container orchestrator.</Description>
|
||||
|
||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/kubernetes-client/csharp</PackageProjectUrl>
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png</PackageIconUrl>
|
||||
<PackageIcon>logo.png</PackageIcon>
|
||||
<PackageTags>kubernetes;docker;containers;</PackageTags>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
|
||||
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="../../logo.png" Pack="true" Visible="false" PackagePath="" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" PrivateAssets="all" />
|
||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.255" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Threading.Tasks;
|
||||
using k8s;
|
||||
using k8s.Models;
|
||||
using k8s.Autorest;
|
||||
|
||||
namespace attach
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using k8s;
|
||||
using k8s.Models;
|
||||
using k8s.Autorest;
|
||||
|
||||
namespace watch
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using k8s;
|
||||
using k8s.Models;
|
||||
|
||||
@@ -3,5 +3,8 @@
|
||||
"sdk": {
|
||||
"version": "6.0.100",
|
||||
"rollForward": "latestMajor"
|
||||
},
|
||||
"msbuild-sdks": {
|
||||
"Microsoft.Build.Traversal" : "3.1.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "prometheus", "examples\prom
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "yaml", "examples\yaml\yaml.csproj", "{17AB0AD8-6C90-42DD-880C-16B5AC4A373F}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.Models", "src\KubernetesClient.Models\KubernetesClient.Models.csproj", "{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KubernetesClient.Basic", "src\KubernetesClient.Basic\KubernetesClient.Basic.csproj", "{927995F5-05CC-4078-8805-8E6CC06914D8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -299,6 +303,30 @@ Global
|
||||
{17AB0AD8-6C90-42DD-880C-16B5AC4A373F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{17AB0AD8-6C90-42DD-880C-16B5AC4A373F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{17AB0AD8-6C90-42DD-880C-16B5AC4A373F}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8}.Release|x86.Build.0 = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|x64.Build.0 = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -324,6 +352,8 @@ Global
|
||||
{DFBB1025-BD22-459D-A04D-E2AB31E129E2} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{682B94E4-1761-48FF-B5D0-87B45DC0C735} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{17AB0AD8-6C90-42DD-880C-16B5AC4A373F} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{F066A4D8-2EF0-4C07-AC0D-BD325DE3FFA8} = {3D1864AA-1FFC-4512-BB13-46055E410F73}
|
||||
{927995F5-05CC-4078-8805-8E6CC06914D8} = {3D1864AA-1FFC-4512-BB13-46055E410F73}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {049A763A-C891-4E8D-80CF-89DD3E22ADC7}
|
||||
|
||||
72
src/KubernetesClient.Basic/AbstractKubernetes.cs
Normal file
72
src/KubernetesClient.Basic/AbstractKubernetes.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using k8s.Autorest;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
public abstract partial class AbstractKubernetes
|
||||
{
|
||||
private sealed class QueryBuilder
|
||||
{
|
||||
private List<string> parameters = new List<string>();
|
||||
|
||||
public void Append(string key, params object[] values)
|
||||
{
|
||||
foreach (var value in values)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case int intval:
|
||||
parameters.Add($"{key}={intval}");
|
||||
break;
|
||||
case string strval:
|
||||
parameters.Add($"{key}={Uri.EscapeDataString(strval)}");
|
||||
break;
|
||||
case bool boolval:
|
||||
parameters.Add($"{key}={(boolval ? "true" : "false")}");
|
||||
break;
|
||||
default:
|
||||
// null
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (parameters.Count > 0)
|
||||
{
|
||||
return "?" + string.Join("&", parameters);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private Task<HttpResponseMessage> SendRequest<T>(T body, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
if (body != null)
|
||||
{
|
||||
var requestContent = KubernetesJson.Serialize(body);
|
||||
httpRequest.Content = new StringContent(requestContent, System.Text.Encoding.UTF8);
|
||||
httpRequest.Content.Headers.ContentType = GetHeader(body);
|
||||
return SendRequestRaw(requestContent, httpRequest, cancellationToken);
|
||||
}
|
||||
|
||||
return SendRequestRaw("", httpRequest, cancellationToken);
|
||||
}
|
||||
|
||||
public virtual TimeSpan HttpClientTimeout { get; set; } = TimeSpan.FromSeconds(100);
|
||||
|
||||
protected abstract Task<HttpOperationResponse<T>> CreateResultAsync<T>(HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, bool? watch, CancellationToken cancellationToken);
|
||||
|
||||
protected abstract HttpRequestMessage CreateRequest(string relativeUri, string method, IDictionary<string, IList<string>> customHeaders);
|
||||
|
||||
protected abstract MediaTypeHeaderValue GetHeader(object body);
|
||||
|
||||
protected abstract Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
5
src/KubernetesClient.Basic/AssemblyInfo.cs
Normal file
5
src/KubernetesClient.Basic/AssemblyInfo.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("KubernetesClient")]
|
||||
[assembly: InternalsVisibleTo("KubernetesClient.VanillaRest")]
|
||||
[assembly: InternalsVisibleTo("KubernetesClient.Tests")]
|
||||
5
src/KubernetesClient.Basic/Global.cs
Normal file
5
src/KubernetesClient.Basic/Global.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Text.Json;
|
||||
global using System.Text.Json.Serialization;
|
||||
18
src/KubernetesClient.Basic/KubernetesClient.Basic.csproj
Normal file
18
src/KubernetesClient.Basic/KubernetesClient.Basic.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<RootNamespace>k8s</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="Generator" />
|
||||
<AdditionalFiles Include="..\..\swagger.json" Generator="api" />
|
||||
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LibKubernetesGenerator\LibKubernetesGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -32,7 +32,7 @@ namespace k8s
|
||||
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
var str = reader.GetString();
|
||||
return DateTimeOffset.ParseExact(str, new[] { Iso8601Format, SerializeFormat }, CultureInfo.InvariantCulture);
|
||||
return DateTimeOffset.ParseExact(str, new[] { Iso8601Format, SerializeFormat }, CultureInfo.InvariantCulture, DateTimeStyles.None);
|
||||
}
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
|
||||
5
src/KubernetesClient.Models/AssemblyInfo.cs
Normal file
5
src/KubernetesClient.Models/AssemblyInfo.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("KubernetesClient")]
|
||||
[assembly: InternalsVisibleTo("KubernetesClient.Basic")]
|
||||
[assembly: InternalsVisibleTo("KubernetesClient.Tests")]
|
||||
5
src/KubernetesClient.Models/Global.cs
Normal file
5
src/KubernetesClient.Models/Global.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
global using System;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Text.Json;
|
||||
global using System.Text.Json.Serialization;
|
||||
@@ -19,6 +19,11 @@ namespace k8s.Models
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, IntstrIntOrString value, JsonSerializerOptions options)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(writer));
|
||||
}
|
||||
|
||||
var s = value?.Value;
|
||||
|
||||
if (long.TryParse(s, out var intv))
|
||||
18
src/KubernetesClient.Models/KubernetesClient.Models.csproj
Normal file
18
src/KubernetesClient.Models/KubernetesClient.Models.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0</TargetFrameworks>
|
||||
<RootNamespace>k8s.Models</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="Generator" />
|
||||
<AdditionalFiles Include="..\..\swagger.json" Generator="model,modelext,versionconverter" />
|
||||
<ProjectReference Include="..\LibKubernetesGenerator\LibKubernetesGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.0" />
|
||||
<PackageReference Include="AutoMapper" Version="10.1.1" />
|
||||
<PackageReference Include="Fractions" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -9,6 +9,11 @@ namespace k8s.Models
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, ResourceQuantity value, JsonSerializerOptions options)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(writer));
|
||||
}
|
||||
|
||||
writer.WriteStringValue(value?.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,6 @@
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using Fractions;
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace k8s.Models
|
||||
{
|
||||
@@ -57,7 +54,7 @@ namespace k8s.Models
|
||||
/// cause implementors to also use a fixed point implementation.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(QuantityConverter))]
|
||||
public partial class ResourceQuantity : IYamlConvertible
|
||||
public partial class ResourceQuantity
|
||||
{
|
||||
public enum SuffixFormat
|
||||
{
|
||||
@@ -201,28 +198,6 @@ namespace k8s.Models
|
||||
return BigInteger.Remainder(value.Numerator, value.Denominator) > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Read(IParser parser, Type expectedType, ObjectDeserializer nestedObjectDeserializer)
|
||||
{
|
||||
if (expectedType != typeof(ResourceQuantity))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(expectedType));
|
||||
}
|
||||
|
||||
if (parser?.Current is Scalar)
|
||||
{
|
||||
Value = ((Scalar)parser.Current).Value;
|
||||
parser.MoveNext();
|
||||
CustomInit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void Write(IEmitter emitter, ObjectSerializer nestedObjectSerializer)
|
||||
{
|
||||
emitter?.Emit(new Scalar(ToString()));
|
||||
}
|
||||
|
||||
public static implicit operator decimal(ResourceQuantity v)
|
||||
{
|
||||
return v?.ToDecimal() ?? 0;
|
||||
@@ -9,6 +9,11 @@ namespace k8s.Models
|
||||
|
||||
public override void Write(Utf8JsonWriter writer, V1Patch value, JsonSerializerOptions options)
|
||||
{
|
||||
if (writer == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(writer));
|
||||
}
|
||||
|
||||
var content = value?.Content;
|
||||
if (content is string s)
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace k8s;
|
||||
|
||||
public partial interface IKubernetes : IDisposable
|
||||
public partial interface IKubernetes : IBasicKubernetes, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The base URI of the service.
|
||||
|
||||
@@ -9,13 +9,6 @@ namespace k8s
|
||||
{
|
||||
public partial class Kubernetes
|
||||
{
|
||||
/// <summary>
|
||||
/// Timeout of REST calls to Kubernetes server
|
||||
/// Does not apply to watch related api
|
||||
/// </summary>
|
||||
/// <value>timeout</value>
|
||||
public TimeSpan HttpClientTimeout { get; set; } = TimeSpan.FromSeconds(100);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Kubernetes" /> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace k8s
|
||||
{
|
||||
public partial class Kubernetes
|
||||
{
|
||||
public virtual MediaTypeHeaderValue GetHeader(object body)
|
||||
protected override MediaTypeHeaderValue GetHeader(object body)
|
||||
{
|
||||
if (body == null)
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace k8s
|
||||
}
|
||||
|
||||
|
||||
public virtual MediaTypeHeaderValue GetHeader(V1Patch body)
|
||||
private MediaTypeHeaderValue GetHeader(V1Patch body)
|
||||
{
|
||||
if (body == null)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using k8s.Autorest;
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
public partial class Kubernetes
|
||||
public partial class Kubernetes : AbstractKubernetes, IKubernetes
|
||||
{
|
||||
private Uri baseuri;
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace k8s
|
||||
private HttpClientHandler HttpClientHandler { get; set; }
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Initializes client properties.
|
||||
/// </summary>
|
||||
@@ -56,8 +55,18 @@ namespace k8s
|
||||
BaseUri = new Uri("http://localhost");
|
||||
}
|
||||
|
||||
private async Task<HttpOperationResponse<T>> CreateResultAsync<T>(HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, bool? watch, CancellationToken cancellationToken)
|
||||
protected override async Task<HttpOperationResponse<T>> CreateResultAsync<T>(HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, bool? watch, CancellationToken cancellationToken)
|
||||
{
|
||||
if (httpRequest == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(httpRequest));
|
||||
}
|
||||
|
||||
if (httpResponse == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(httpResponse));
|
||||
}
|
||||
|
||||
var result = new HttpOperationResponse<T>() { Request = httpRequest, Response = httpResponse };
|
||||
|
||||
if (watch == true)
|
||||
@@ -86,48 +95,11 @@ namespace k8s
|
||||
return result;
|
||||
}
|
||||
|
||||
private sealed class QueryBuilder
|
||||
{
|
||||
private List<string> parameters = new List<string>();
|
||||
|
||||
public void Append(string key, params object[] values)
|
||||
{
|
||||
foreach (var value in values)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case int intval:
|
||||
parameters.Add($"{key}={intval}");
|
||||
break;
|
||||
case string strval:
|
||||
parameters.Add($"{key}={Uri.EscapeDataString(strval)}");
|
||||
break;
|
||||
case bool boolval:
|
||||
parameters.Add($"{key}={(boolval ? "true" : "false")}");
|
||||
break;
|
||||
default:
|
||||
// null
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (parameters.Count > 0)
|
||||
{
|
||||
return "?" + string.Join("&", parameters);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequestMessage CreateRequest(string url, HttpMethod method, IDictionary<string, IList<string>> customHeaders)
|
||||
protected override HttpRequestMessage CreateRequest(string relativeUri, string method, IDictionary<string, IList<string>> customHeaders)
|
||||
{
|
||||
var httpRequest = new HttpRequestMessage();
|
||||
httpRequest.Method = method;
|
||||
httpRequest.RequestUri = new Uri(url);
|
||||
httpRequest.Method = new HttpMethod(method);
|
||||
httpRequest.RequestUri = new Uri(BaseUri, relativeUri);
|
||||
httpRequest.Version = HttpVersion.Version20;
|
||||
// Set Headers
|
||||
if (customHeaders != null)
|
||||
@@ -142,21 +114,13 @@ namespace k8s
|
||||
return httpRequest;
|
||||
}
|
||||
|
||||
private Task<HttpResponseMessage> SendRequest<T>(T body, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
protected override async Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
if (body != null)
|
||||
if (httpRequest == null)
|
||||
{
|
||||
var requestContent = KubernetesJson.Serialize(body);
|
||||
httpRequest.Content = new StringContent(requestContent, System.Text.Encoding.UTF8);
|
||||
httpRequest.Content.Headers.ContentType = GetHeader(body);
|
||||
return SendRequestRaw(requestContent, httpRequest, cancellationToken);
|
||||
throw new ArgumentNullException(nameof(httpRequest));
|
||||
}
|
||||
|
||||
return SendRequestRaw("", httpRequest, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
// Set Credentials
|
||||
if (Credentials != null)
|
||||
{
|
||||
|
||||
@@ -1,60 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Authors>The Kubernetes Project Authors</Authors>
|
||||
<Copyright>2017 The Kubernetes Project Authors</Copyright>
|
||||
<Description>Client library for the Kubernetes open source container orchestrator.</Description>
|
||||
|
||||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/kubernetes-client/csharp</PackageProjectUrl>
|
||||
<PackageIconUrl>https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png</PackageIconUrl>
|
||||
<PackageIcon>logo.png</PackageIcon>
|
||||
<PackageTags>kubernetes;docker;containers;</PackageTags>
|
||||
|
||||
<TargetFrameworks>netstandard2.1;net5;net6</TargetFrameworks>
|
||||
<RootNamespace>k8s</RootNamespace>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
<!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
|
||||
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="swagger.json" />
|
||||
<None Include="../../logo.png" Pack="true" Visible="false" PackagePath="" />
|
||||
<ProjectReference Include="..\LibKubernetesGenerator\LibKubernetesGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="10.1.1" />
|
||||
<PackageReference Include="Fractions" Version="7.0.0" />
|
||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.255" PrivateAssets="all" />
|
||||
<PackageReference Include="prometheus-net" Version="5.0.1" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="13.2.47" />
|
||||
<PackageReference Include="YamlDotNet" Version="11.2.1" />
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||
<PackageReference Include="IdentityModel.OidcClient" Version="4.0.0" />
|
||||
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" Condition="'$(TargetFramework)' == 'netstandard2.1'" />
|
||||
<PackageReference Include="System.Text.Json" Version="6.0.0" Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net5'" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Util\Informer" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" />
|
||||
<ProjectReference Include="..\KubernetesClient.Basic\KubernetesClient.Basic.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
42
src/KubernetesClient/ResourceQuantityYamlConverter.cs
Normal file
42
src/KubernetesClient/ResourceQuantityYamlConverter.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace k8s.Models
|
||||
{
|
||||
public class ResourceQuantityYamlConverter : IYamlTypeConverter
|
||||
{
|
||||
public bool Accepts(Type type)
|
||||
{
|
||||
return type == typeof(ResourceQuantity);
|
||||
}
|
||||
|
||||
public object ReadYaml(IParser parser, Type type)
|
||||
{
|
||||
if (parser?.Current is YamlDotNet.Core.Events.Scalar scalar)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(scalar?.Value))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new ResourceQuantity(scalar?.Value);
|
||||
}
|
||||
finally
|
||||
{
|
||||
parser?.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidOperationException(parser?.Current?.ToString());
|
||||
}
|
||||
|
||||
|
||||
public void WriteYaml(IEmitter emitter, object value, Type type)
|
||||
{
|
||||
var obj = (ResourceQuantity)value;
|
||||
emitter?.Emit(new YamlDotNet.Core.Events.Scalar(obj?.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,726 +0,0 @@
|
||||
// using k8s.Versioning;
|
||||
// namespace k8s.Models
|
||||
// {
|
||||
// public partial class V1MutatingWebhookConfiguration
|
||||
// {
|
||||
// public static explicit operator V1MutatingWebhookConfiguration(V1beta1MutatingWebhookConfiguration s) => VersionConverter.Mapper.Map<V1MutatingWebhookConfiguration>(s);
|
||||
// }
|
||||
// public partial class V1beta1MutatingWebhookConfiguration
|
||||
// {
|
||||
// public static explicit operator V1beta1MutatingWebhookConfiguration(V1MutatingWebhookConfiguration s) => VersionConverter.Mapper.Map<V1beta1MutatingWebhookConfiguration>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1MutatingWebhookConfigurationList
|
||||
// {
|
||||
// public static explicit operator V1MutatingWebhookConfigurationList(V1beta1MutatingWebhookConfigurationList s) => VersionConverter.Mapper.Map<V1MutatingWebhookConfigurationList>(s);
|
||||
// }
|
||||
// public partial class V1beta1MutatingWebhookConfigurationList
|
||||
// {
|
||||
// public static explicit operator V1beta1MutatingWebhookConfigurationList(V1MutatingWebhookConfigurationList s) => VersionConverter.Mapper.Map<V1beta1MutatingWebhookConfigurationList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ValidatingWebhookConfiguration
|
||||
// {
|
||||
// public static explicit operator V1ValidatingWebhookConfiguration(V1beta1ValidatingWebhookConfiguration s) => VersionConverter.Mapper.Map<V1ValidatingWebhookConfiguration>(s);
|
||||
// }
|
||||
// public partial class V1beta1ValidatingWebhookConfiguration
|
||||
// {
|
||||
// public static explicit operator V1beta1ValidatingWebhookConfiguration(V1ValidatingWebhookConfiguration s) => VersionConverter.Mapper.Map<V1beta1ValidatingWebhookConfiguration>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ValidatingWebhookConfigurationList
|
||||
// {
|
||||
// public static explicit operator V1ValidatingWebhookConfigurationList(V1beta1ValidatingWebhookConfigurationList s) => VersionConverter.Mapper.Map<V1ValidatingWebhookConfigurationList>(s);
|
||||
// }
|
||||
// public partial class V1beta1ValidatingWebhookConfigurationList
|
||||
// {
|
||||
// public static explicit operator V1beta1ValidatingWebhookConfigurationList(V1ValidatingWebhookConfigurationList s) => VersionConverter.Mapper.Map<V1beta1ValidatingWebhookConfigurationList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1TokenReview
|
||||
// {
|
||||
// public static explicit operator V1TokenReview(V1beta1TokenReview s) => VersionConverter.Mapper.Map<V1TokenReview>(s);
|
||||
// }
|
||||
// public partial class V1beta1TokenReview
|
||||
// {
|
||||
// public static explicit operator V1beta1TokenReview(V1TokenReview s) => VersionConverter.Mapper.Map<V1beta1TokenReview>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1LocalSubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1LocalSubjectAccessReview(V1beta1LocalSubjectAccessReview s) => VersionConverter.Mapper.Map<V1LocalSubjectAccessReview>(s);
|
||||
// }
|
||||
// public partial class V1beta1LocalSubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1beta1LocalSubjectAccessReview(V1LocalSubjectAccessReview s) => VersionConverter.Mapper.Map<V1beta1LocalSubjectAccessReview>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SelfSubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1SelfSubjectAccessReview(V1beta1SelfSubjectAccessReview s) => VersionConverter.Mapper.Map<V1SelfSubjectAccessReview>(s);
|
||||
// }
|
||||
// public partial class V1beta1SelfSubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1beta1SelfSubjectAccessReview(V1SelfSubjectAccessReview s) => VersionConverter.Mapper.Map<V1beta1SelfSubjectAccessReview>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SelfSubjectRulesReview
|
||||
// {
|
||||
// public static explicit operator V1SelfSubjectRulesReview(V1beta1SelfSubjectRulesReview s) => VersionConverter.Mapper.Map<V1SelfSubjectRulesReview>(s);
|
||||
// }
|
||||
// public partial class V1beta1SelfSubjectRulesReview
|
||||
// {
|
||||
// public static explicit operator V1beta1SelfSubjectRulesReview(V1SelfSubjectRulesReview s) => VersionConverter.Mapper.Map<V1beta1SelfSubjectRulesReview>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1SubjectAccessReview(V1beta1SubjectAccessReview s) => VersionConverter.Mapper.Map<V1SubjectAccessReview>(s);
|
||||
// }
|
||||
// public partial class V1beta1SubjectAccessReview
|
||||
// {
|
||||
// public static explicit operator V1beta1SubjectAccessReview(V1SubjectAccessReview s) => VersionConverter.Mapper.Map<V1beta1SubjectAccessReview>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1Lease
|
||||
// {
|
||||
// public static explicit operator V1Lease(V1beta1Lease s) => VersionConverter.Mapper.Map<V1Lease>(s);
|
||||
// }
|
||||
// public partial class V1beta1Lease
|
||||
// {
|
||||
// public static explicit operator V1beta1Lease(V1Lease s) => VersionConverter.Mapper.Map<V1beta1Lease>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1LeaseList
|
||||
// {
|
||||
// public static explicit operator V1LeaseList(V1beta1LeaseList s) => VersionConverter.Mapper.Map<V1LeaseList>(s);
|
||||
// }
|
||||
// public partial class V1beta1LeaseList
|
||||
// {
|
||||
// public static explicit operator V1beta1LeaseList(V1LeaseList s) => VersionConverter.Mapper.Map<V1beta1LeaseList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1Event
|
||||
// {
|
||||
// public static explicit operator V1Event(V1beta1Event s) => VersionConverter.Mapper.Map<V1Event>(s);
|
||||
// }
|
||||
// public partial class V1beta1Event
|
||||
// {
|
||||
// public static explicit operator V1beta1Event(V1Event s) => VersionConverter.Mapper.Map<V1beta1Event>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1EventList
|
||||
// {
|
||||
// public static explicit operator V1EventList(V1beta1EventList s) => VersionConverter.Mapper.Map<V1EventList>(s);
|
||||
// }
|
||||
// public partial class V1beta1EventList
|
||||
// {
|
||||
// public static explicit operator V1beta1EventList(V1EventList s) => VersionConverter.Mapper.Map<V1beta1EventList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ClusterRole
|
||||
// {
|
||||
// public static explicit operator V1ClusterRole(V1beta1ClusterRole s) => VersionConverter.Mapper.Map<V1ClusterRole>(s);
|
||||
// }
|
||||
// public partial class V1beta1ClusterRole
|
||||
// {
|
||||
// public static explicit operator V1beta1ClusterRole(V1ClusterRole s) => VersionConverter.Mapper.Map<V1beta1ClusterRole>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ClusterRoleBinding
|
||||
// {
|
||||
// public static explicit operator V1ClusterRoleBinding(V1beta1ClusterRoleBinding s) => VersionConverter.Mapper.Map<V1ClusterRoleBinding>(s);
|
||||
// }
|
||||
// public partial class V1beta1ClusterRoleBinding
|
||||
// {
|
||||
// public static explicit operator V1beta1ClusterRoleBinding(V1ClusterRoleBinding s) => VersionConverter.Mapper.Map<V1beta1ClusterRoleBinding>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ClusterRoleBindingList
|
||||
// {
|
||||
// public static explicit operator V1ClusterRoleBindingList(V1beta1ClusterRoleBindingList s) => VersionConverter.Mapper.Map<V1ClusterRoleBindingList>(s);
|
||||
// }
|
||||
// public partial class V1beta1ClusterRoleBindingList
|
||||
// {
|
||||
// public static explicit operator V1beta1ClusterRoleBindingList(V1ClusterRoleBindingList s) => VersionConverter.Mapper.Map<V1beta1ClusterRoleBindingList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ClusterRoleList
|
||||
// {
|
||||
// public static explicit operator V1ClusterRoleList(V1beta1ClusterRoleList s) => VersionConverter.Mapper.Map<V1ClusterRoleList>(s);
|
||||
// }
|
||||
// public partial class V1beta1ClusterRoleList
|
||||
// {
|
||||
// public static explicit operator V1beta1ClusterRoleList(V1ClusterRoleList s) => VersionConverter.Mapper.Map<V1beta1ClusterRoleList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1Role
|
||||
// {
|
||||
// public static explicit operator V1Role(V1beta1Role s) => VersionConverter.Mapper.Map<V1Role>(s);
|
||||
// }
|
||||
// public partial class V1beta1Role
|
||||
// {
|
||||
// public static explicit operator V1beta1Role(V1Role s) => VersionConverter.Mapper.Map<V1beta1Role>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1RoleBinding
|
||||
// {
|
||||
// public static explicit operator V1RoleBinding(V1beta1RoleBinding s) => VersionConverter.Mapper.Map<V1RoleBinding>(s);
|
||||
// }
|
||||
// public partial class V1beta1RoleBinding
|
||||
// {
|
||||
// public static explicit operator V1beta1RoleBinding(V1RoleBinding s) => VersionConverter.Mapper.Map<V1beta1RoleBinding>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1RoleBindingList
|
||||
// {
|
||||
// public static explicit operator V1RoleBindingList(V1beta1RoleBindingList s) => VersionConverter.Mapper.Map<V1RoleBindingList>(s);
|
||||
// }
|
||||
// public partial class V1beta1RoleBindingList
|
||||
// {
|
||||
// public static explicit operator V1beta1RoleBindingList(V1RoleBindingList s) => VersionConverter.Mapper.Map<V1beta1RoleBindingList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1RoleList
|
||||
// {
|
||||
// public static explicit operator V1RoleList(V1beta1RoleList s) => VersionConverter.Mapper.Map<V1RoleList>(s);
|
||||
// }
|
||||
// public partial class V1beta1RoleList
|
||||
// {
|
||||
// public static explicit operator V1beta1RoleList(V1RoleList s) => VersionConverter.Mapper.Map<V1beta1RoleList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1PriorityClass
|
||||
// {
|
||||
// public static explicit operator V1PriorityClass(V1beta1PriorityClass s) => VersionConverter.Mapper.Map<V1PriorityClass>(s);
|
||||
// }
|
||||
// public partial class V1beta1PriorityClass
|
||||
// {
|
||||
// public static explicit operator V1beta1PriorityClass(V1PriorityClass s) => VersionConverter.Mapper.Map<V1beta1PriorityClass>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1PriorityClassList
|
||||
// {
|
||||
// public static explicit operator V1PriorityClassList(V1beta1PriorityClassList s) => VersionConverter.Mapper.Map<V1PriorityClassList>(s);
|
||||
// }
|
||||
// public partial class V1beta1PriorityClassList
|
||||
// {
|
||||
// public static explicit operator V1beta1PriorityClassList(V1PriorityClassList s) => VersionConverter.Mapper.Map<V1beta1PriorityClassList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSIDriver
|
||||
// {
|
||||
// public static explicit operator V1CSIDriver(V1beta1CSIDriver s) => VersionConverter.Mapper.Map<V1CSIDriver>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSIDriver
|
||||
// {
|
||||
// public static explicit operator V1beta1CSIDriver(V1CSIDriver s) => VersionConverter.Mapper.Map<V1beta1CSIDriver>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSIDriverList
|
||||
// {
|
||||
// public static explicit operator V1CSIDriverList(V1beta1CSIDriverList s) => VersionConverter.Mapper.Map<V1CSIDriverList>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSIDriverList
|
||||
// {
|
||||
// public static explicit operator V1beta1CSIDriverList(V1CSIDriverList s) => VersionConverter.Mapper.Map<V1beta1CSIDriverList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSINode
|
||||
// {
|
||||
// public static explicit operator V1CSINode(V1beta1CSINode s) => VersionConverter.Mapper.Map<V1CSINode>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSINode
|
||||
// {
|
||||
// public static explicit operator V1beta1CSINode(V1CSINode s) => VersionConverter.Mapper.Map<V1beta1CSINode>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSINodeList
|
||||
// {
|
||||
// public static explicit operator V1CSINodeList(V1beta1CSINodeList s) => VersionConverter.Mapper.Map<V1CSINodeList>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSINodeList
|
||||
// {
|
||||
// public static explicit operator V1beta1CSINodeList(V1CSINodeList s) => VersionConverter.Mapper.Map<V1beta1CSINodeList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1StorageClass
|
||||
// {
|
||||
// public static explicit operator V1StorageClass(V1beta1StorageClass s) => VersionConverter.Mapper.Map<V1StorageClass>(s);
|
||||
// }
|
||||
// public partial class V1beta1StorageClass
|
||||
// {
|
||||
// public static explicit operator V1beta1StorageClass(V1StorageClass s) => VersionConverter.Mapper.Map<V1beta1StorageClass>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1StorageClassList
|
||||
// {
|
||||
// public static explicit operator V1StorageClassList(V1beta1StorageClassList s) => VersionConverter.Mapper.Map<V1StorageClassList>(s);
|
||||
// }
|
||||
// public partial class V1beta1StorageClassList
|
||||
// {
|
||||
// public static explicit operator V1beta1StorageClassList(V1StorageClassList s) => VersionConverter.Mapper.Map<V1beta1StorageClassList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeAttachment
|
||||
// {
|
||||
// public static explicit operator V1VolumeAttachment(V1beta1VolumeAttachment s) => VersionConverter.Mapper.Map<V1VolumeAttachment>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeAttachment
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeAttachment(V1VolumeAttachment s) => VersionConverter.Mapper.Map<V1beta1VolumeAttachment>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeAttachmentList
|
||||
// {
|
||||
// public static explicit operator V1VolumeAttachmentList(V1beta1VolumeAttachmentList s) => VersionConverter.Mapper.Map<V1VolumeAttachmentList>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeAttachmentList
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeAttachmentList(V1VolumeAttachmentList s) => VersionConverter.Mapper.Map<V1beta1VolumeAttachmentList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinition
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinition(V1beta1CustomResourceDefinition s) => VersionConverter.Mapper.Map<V1CustomResourceDefinition>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinition
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinition(V1CustomResourceDefinition s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinition>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionList
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionList(V1beta1CustomResourceDefinitionList s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionList>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionList
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionList(V1CustomResourceDefinitionList s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1APIService
|
||||
// {
|
||||
// public static explicit operator V1APIService(V1beta1APIService s) => VersionConverter.Mapper.Map<V1APIService>(s);
|
||||
// }
|
||||
// public partial class V1beta1APIService
|
||||
// {
|
||||
// public static explicit operator V1beta1APIService(V1APIService s) => VersionConverter.Mapper.Map<V1beta1APIService>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1APIServiceList
|
||||
// {
|
||||
// public static explicit operator V1APIServiceList(V1beta1APIServiceList s) => VersionConverter.Mapper.Map<V1APIServiceList>(s);
|
||||
// }
|
||||
// public partial class V1beta1APIServiceList
|
||||
// {
|
||||
// public static explicit operator V1beta1APIServiceList(V1APIServiceList s) => VersionConverter.Mapper.Map<V1beta1APIServiceList>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1AggregationRule
|
||||
// {
|
||||
// public static explicit operator V1AggregationRule(V1beta1AggregationRule s) => VersionConverter.Mapper.Map<V1AggregationRule>(s);
|
||||
// }
|
||||
// public partial class V1beta1AggregationRule
|
||||
// {
|
||||
// public static explicit operator V1beta1AggregationRule(V1AggregationRule s) => VersionConverter.Mapper.Map<V1beta1AggregationRule>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1APIServiceCondition
|
||||
// {
|
||||
// public static explicit operator V1APIServiceCondition(V1beta1APIServiceCondition s) => VersionConverter.Mapper.Map<V1APIServiceCondition>(s);
|
||||
// }
|
||||
// public partial class V1beta1APIServiceCondition
|
||||
// {
|
||||
// public static explicit operator V1beta1APIServiceCondition(V1APIServiceCondition s) => VersionConverter.Mapper.Map<V1beta1APIServiceCondition>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1APIServiceSpec
|
||||
// {
|
||||
// public static explicit operator V1APIServiceSpec(V1beta1APIServiceSpec s) => VersionConverter.Mapper.Map<V1APIServiceSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1APIServiceSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1APIServiceSpec(V1APIServiceSpec s) => VersionConverter.Mapper.Map<V1beta1APIServiceSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1APIServiceStatus
|
||||
// {
|
||||
// public static explicit operator V1APIServiceStatus(V1beta1APIServiceStatus s) => VersionConverter.Mapper.Map<V1APIServiceStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1APIServiceStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1APIServiceStatus(V1APIServiceStatus s) => VersionConverter.Mapper.Map<V1beta1APIServiceStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSIDriverSpec
|
||||
// {
|
||||
// public static explicit operator V1CSIDriverSpec(V1beta1CSIDriverSpec s) => VersionConverter.Mapper.Map<V1CSIDriverSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSIDriverSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1CSIDriverSpec(V1CSIDriverSpec s) => VersionConverter.Mapper.Map<V1beta1CSIDriverSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSINodeDriver
|
||||
// {
|
||||
// public static explicit operator V1CSINodeDriver(V1beta1CSINodeDriver s) => VersionConverter.Mapper.Map<V1CSINodeDriver>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSINodeDriver
|
||||
// {
|
||||
// public static explicit operator V1beta1CSINodeDriver(V1CSINodeDriver s) => VersionConverter.Mapper.Map<V1beta1CSINodeDriver>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CSINodeSpec
|
||||
// {
|
||||
// public static explicit operator V1CSINodeSpec(V1beta1CSINodeSpec s) => VersionConverter.Mapper.Map<V1CSINodeSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1CSINodeSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1CSINodeSpec(V1CSINodeSpec s) => VersionConverter.Mapper.Map<V1beta1CSINodeSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceColumnDefinition
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceColumnDefinition(V1beta1CustomResourceColumnDefinition s) => VersionConverter.Mapper.Map<V1CustomResourceColumnDefinition>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceColumnDefinition
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceColumnDefinition(V1CustomResourceColumnDefinition s) => VersionConverter.Mapper.Map<V1beta1CustomResourceColumnDefinition>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceConversion
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceConversion(V1beta1CustomResourceConversion s) => VersionConverter.Mapper.Map<V1CustomResourceConversion>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceConversion
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceConversion(V1CustomResourceConversion s) => VersionConverter.Mapper.Map<V1beta1CustomResourceConversion>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionCondition
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionCondition(V1beta1CustomResourceDefinitionCondition s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionCondition>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionCondition
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionCondition(V1CustomResourceDefinitionCondition s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionCondition>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionNames
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionNames(V1beta1CustomResourceDefinitionNames s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionNames>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionNames
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionNames(V1CustomResourceDefinitionNames s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionNames>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionSpec
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionSpec(V1beta1CustomResourceDefinitionSpec s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionSpec(V1CustomResourceDefinitionSpec s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionStatus
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionStatus(V1beta1CustomResourceDefinitionStatus s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionStatus(V1CustomResourceDefinitionStatus s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceDefinitionVersion
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceDefinitionVersion(V1beta1CustomResourceDefinitionVersion s) => VersionConverter.Mapper.Map<V1CustomResourceDefinitionVersion>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceDefinitionVersion
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceDefinitionVersion(V1CustomResourceDefinitionVersion s) => VersionConverter.Mapper.Map<V1beta1CustomResourceDefinitionVersion>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceSubresources
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceSubresources(V1beta1CustomResourceSubresources s) => VersionConverter.Mapper.Map<V1CustomResourceSubresources>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceSubresources
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceSubresources(V1CustomResourceSubresources s) => VersionConverter.Mapper.Map<V1beta1CustomResourceSubresources>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceSubresourceScale
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceSubresourceScale(V1beta1CustomResourceSubresourceScale s) => VersionConverter.Mapper.Map<V1CustomResourceSubresourceScale>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceSubresourceScale
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceSubresourceScale(V1CustomResourceSubresourceScale s) => VersionConverter.Mapper.Map<V1beta1CustomResourceSubresourceScale>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1CustomResourceValidation
|
||||
// {
|
||||
// public static explicit operator V1CustomResourceValidation(V1beta1CustomResourceValidation s) => VersionConverter.Mapper.Map<V1CustomResourceValidation>(s);
|
||||
// }
|
||||
// public partial class V1beta1CustomResourceValidation
|
||||
// {
|
||||
// public static explicit operator V1beta1CustomResourceValidation(V1CustomResourceValidation s) => VersionConverter.Mapper.Map<V1beta1CustomResourceValidation>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1EndpointPort
|
||||
// {
|
||||
// public static explicit operator V1EndpointPort(V1beta1EndpointPort s) => VersionConverter.Mapper.Map<V1EndpointPort>(s);
|
||||
// }
|
||||
// public partial class V1beta1EndpointPort
|
||||
// {
|
||||
// public static explicit operator V1beta1EndpointPort(V1EndpointPort s) => VersionConverter.Mapper.Map<V1beta1EndpointPort>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1EventSeries
|
||||
// {
|
||||
// public static explicit operator V1EventSeries(V1beta1EventSeries s) => VersionConverter.Mapper.Map<V1EventSeries>(s);
|
||||
// }
|
||||
// public partial class V1beta1EventSeries
|
||||
// {
|
||||
// public static explicit operator V1beta1EventSeries(V1EventSeries s) => VersionConverter.Mapper.Map<V1beta1EventSeries>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ExternalDocumentation
|
||||
// {
|
||||
// public static explicit operator V1ExternalDocumentation(V1beta1ExternalDocumentation s) => VersionConverter.Mapper.Map<V1ExternalDocumentation>(s);
|
||||
// }
|
||||
// public partial class V1beta1ExternalDocumentation
|
||||
// {
|
||||
// public static explicit operator V1beta1ExternalDocumentation(V1ExternalDocumentation s) => VersionConverter.Mapper.Map<V1beta1ExternalDocumentation>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1JSONSchemaProps
|
||||
// {
|
||||
// public static explicit operator V1JSONSchemaProps(V1beta1JSONSchemaProps s) => VersionConverter.Mapper.Map<V1JSONSchemaProps>(s);
|
||||
// }
|
||||
// public partial class V1beta1JSONSchemaProps
|
||||
// {
|
||||
// public static explicit operator V1beta1JSONSchemaProps(V1JSONSchemaProps s) => VersionConverter.Mapper.Map<V1beta1JSONSchemaProps>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1LeaseSpec
|
||||
// {
|
||||
// public static explicit operator V1LeaseSpec(V1beta1LeaseSpec s) => VersionConverter.Mapper.Map<V1LeaseSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1LeaseSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1LeaseSpec(V1LeaseSpec s) => VersionConverter.Mapper.Map<V1beta1LeaseSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1MutatingWebhook
|
||||
// {
|
||||
// public static explicit operator V1MutatingWebhook(V1beta1MutatingWebhook s) => VersionConverter.Mapper.Map<V1MutatingWebhook>(s);
|
||||
// }
|
||||
// public partial class V1beta1MutatingWebhook
|
||||
// {
|
||||
// public static explicit operator V1beta1MutatingWebhook(V1MutatingWebhook s) => VersionConverter.Mapper.Map<V1beta1MutatingWebhook>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1NonResourceAttributes
|
||||
// {
|
||||
// public static explicit operator V1NonResourceAttributes(V1beta1NonResourceAttributes s) => VersionConverter.Mapper.Map<V1NonResourceAttributes>(s);
|
||||
// }
|
||||
// public partial class V1beta1NonResourceAttributes
|
||||
// {
|
||||
// public static explicit operator V1beta1NonResourceAttributes(V1NonResourceAttributes s) => VersionConverter.Mapper.Map<V1beta1NonResourceAttributes>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1NonResourceRule
|
||||
// {
|
||||
// public static explicit operator V1NonResourceRule(V1beta1NonResourceRule s) => VersionConverter.Mapper.Map<V1NonResourceRule>(s);
|
||||
// }
|
||||
// public partial class V1beta1NonResourceRule
|
||||
// {
|
||||
// public static explicit operator V1beta1NonResourceRule(V1NonResourceRule s) => VersionConverter.Mapper.Map<V1beta1NonResourceRule>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1PolicyRule
|
||||
// {
|
||||
// public static explicit operator V1PolicyRule(V1beta1PolicyRule s) => VersionConverter.Mapper.Map<V1PolicyRule>(s);
|
||||
// }
|
||||
// public partial class V1beta1PolicyRule
|
||||
// {
|
||||
// public static explicit operator V1beta1PolicyRule(V1PolicyRule s) => VersionConverter.Mapper.Map<V1beta1PolicyRule>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ResourceAttributes
|
||||
// {
|
||||
// public static explicit operator V1ResourceAttributes(V1beta1ResourceAttributes s) => VersionConverter.Mapper.Map<V1ResourceAttributes>(s);
|
||||
// }
|
||||
// public partial class V1beta1ResourceAttributes
|
||||
// {
|
||||
// public static explicit operator V1beta1ResourceAttributes(V1ResourceAttributes s) => VersionConverter.Mapper.Map<V1beta1ResourceAttributes>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ResourceRule
|
||||
// {
|
||||
// public static explicit operator V1ResourceRule(V1beta1ResourceRule s) => VersionConverter.Mapper.Map<V1ResourceRule>(s);
|
||||
// }
|
||||
// public partial class V1beta1ResourceRule
|
||||
// {
|
||||
// public static explicit operator V1beta1ResourceRule(V1ResourceRule s) => VersionConverter.Mapper.Map<V1beta1ResourceRule>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1RoleRef
|
||||
// {
|
||||
// public static explicit operator V1RoleRef(V1beta1RoleRef s) => VersionConverter.Mapper.Map<V1RoleRef>(s);
|
||||
// }
|
||||
// public partial class V1beta1RoleRef
|
||||
// {
|
||||
// public static explicit operator V1beta1RoleRef(V1RoleRef s) => VersionConverter.Mapper.Map<V1beta1RoleRef>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1RuleWithOperations
|
||||
// {
|
||||
// public static explicit operator V1RuleWithOperations(V1beta1RuleWithOperations s) => VersionConverter.Mapper.Map<V1RuleWithOperations>(s);
|
||||
// }
|
||||
// public partial class V1beta1RuleWithOperations
|
||||
// {
|
||||
// public static explicit operator V1beta1RuleWithOperations(V1RuleWithOperations s) => VersionConverter.Mapper.Map<V1beta1RuleWithOperations>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SelfSubjectAccessReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1SelfSubjectAccessReviewSpec(V1beta1SelfSubjectAccessReviewSpec s) => VersionConverter.Mapper.Map<V1SelfSubjectAccessReviewSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1SelfSubjectAccessReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1SelfSubjectAccessReviewSpec(V1SelfSubjectAccessReviewSpec s) => VersionConverter.Mapper.Map<V1beta1SelfSubjectAccessReviewSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SelfSubjectRulesReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1SelfSubjectRulesReviewSpec(V1beta1SelfSubjectRulesReviewSpec s) => VersionConverter.Mapper.Map<V1SelfSubjectRulesReviewSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1SelfSubjectRulesReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1SelfSubjectRulesReviewSpec(V1SelfSubjectRulesReviewSpec s) => VersionConverter.Mapper.Map<V1beta1SelfSubjectRulesReviewSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1Subject
|
||||
// {
|
||||
// public static explicit operator V1Subject(V1beta1Subject s) => VersionConverter.Mapper.Map<V1Subject>(s);
|
||||
// }
|
||||
// public partial class V1beta1Subject
|
||||
// {
|
||||
// public static explicit operator V1beta1Subject(V1Subject s) => VersionConverter.Mapper.Map<V1beta1Subject>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SubjectAccessReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1SubjectAccessReviewSpec(V1beta1SubjectAccessReviewSpec s) => VersionConverter.Mapper.Map<V1SubjectAccessReviewSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1SubjectAccessReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1SubjectAccessReviewSpec(V1SubjectAccessReviewSpec s) => VersionConverter.Mapper.Map<V1beta1SubjectAccessReviewSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SubjectAccessReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1SubjectAccessReviewStatus(V1beta1SubjectAccessReviewStatus s) => VersionConverter.Mapper.Map<V1SubjectAccessReviewStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1SubjectAccessReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1SubjectAccessReviewStatus(V1SubjectAccessReviewStatus s) => VersionConverter.Mapper.Map<V1beta1SubjectAccessReviewStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1SubjectRulesReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1SubjectRulesReviewStatus(V1beta1SubjectRulesReviewStatus s) => VersionConverter.Mapper.Map<V1SubjectRulesReviewStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1SubjectRulesReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1SubjectRulesReviewStatus(V1SubjectRulesReviewStatus s) => VersionConverter.Mapper.Map<V1beta1SubjectRulesReviewStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1TokenReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1TokenReviewSpec(V1beta1TokenReviewSpec s) => VersionConverter.Mapper.Map<V1TokenReviewSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1TokenReviewSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1TokenReviewSpec(V1TokenReviewSpec s) => VersionConverter.Mapper.Map<V1beta1TokenReviewSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1TokenReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1TokenReviewStatus(V1beta1TokenReviewStatus s) => VersionConverter.Mapper.Map<V1TokenReviewStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1TokenReviewStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1TokenReviewStatus(V1TokenReviewStatus s) => VersionConverter.Mapper.Map<V1beta1TokenReviewStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1UserInfo
|
||||
// {
|
||||
// public static explicit operator V1UserInfo(V1beta1UserInfo s) => VersionConverter.Mapper.Map<V1UserInfo>(s);
|
||||
// }
|
||||
// public partial class V1beta1UserInfo
|
||||
// {
|
||||
// public static explicit operator V1beta1UserInfo(V1UserInfo s) => VersionConverter.Mapper.Map<V1beta1UserInfo>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1ValidatingWebhook
|
||||
// {
|
||||
// public static explicit operator V1ValidatingWebhook(V1beta1ValidatingWebhook s) => VersionConverter.Mapper.Map<V1ValidatingWebhook>(s);
|
||||
// }
|
||||
// public partial class V1beta1ValidatingWebhook
|
||||
// {
|
||||
// public static explicit operator V1beta1ValidatingWebhook(V1ValidatingWebhook s) => VersionConverter.Mapper.Map<V1beta1ValidatingWebhook>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeAttachmentSource
|
||||
// {
|
||||
// public static explicit operator V1VolumeAttachmentSource(V1beta1VolumeAttachmentSource s) => VersionConverter.Mapper.Map<V1VolumeAttachmentSource>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeAttachmentSource
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeAttachmentSource(V1VolumeAttachmentSource s) => VersionConverter.Mapper.Map<V1beta1VolumeAttachmentSource>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeAttachmentSpec
|
||||
// {
|
||||
// public static explicit operator V1VolumeAttachmentSpec(V1beta1VolumeAttachmentSpec s) => VersionConverter.Mapper.Map<V1VolumeAttachmentSpec>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeAttachmentSpec
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeAttachmentSpec(V1VolumeAttachmentSpec s) => VersionConverter.Mapper.Map<V1beta1VolumeAttachmentSpec>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeAttachmentStatus
|
||||
// {
|
||||
// public static explicit operator V1VolumeAttachmentStatus(V1beta1VolumeAttachmentStatus s) => VersionConverter.Mapper.Map<V1VolumeAttachmentStatus>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeAttachmentStatus
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeAttachmentStatus(V1VolumeAttachmentStatus s) => VersionConverter.Mapper.Map<V1beta1VolumeAttachmentStatus>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeError
|
||||
// {
|
||||
// public static explicit operator V1VolumeError(V1beta1VolumeError s) => VersionConverter.Mapper.Map<V1VolumeError>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeError
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeError(V1VolumeError s) => VersionConverter.Mapper.Map<V1beta1VolumeError>(s);
|
||||
// }
|
||||
//
|
||||
// public partial class V1VolumeNodeResources
|
||||
// {
|
||||
// public static explicit operator V1VolumeNodeResources(V1beta1VolumeNodeResources s) => VersionConverter.Mapper.Map<V1VolumeNodeResources>(s);
|
||||
// }
|
||||
// public partial class V1beta1VolumeNodeResources
|
||||
// {
|
||||
// public static explicit operator V1beta1VolumeNodeResources(V1VolumeNodeResources s) => VersionConverter.Mapper.Map<V1beta1VolumeNodeResources>(s);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// }
|
||||
@@ -20,6 +20,7 @@ namespace k8s
|
||||
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
||||
.WithTypeConverter(new IntOrStringYamlConverter())
|
||||
.WithTypeConverter(new ByteArrayStringYamlConverter())
|
||||
.WithTypeConverter(new ResourceQuantityYamlConverter())
|
||||
.WithOverridesFromJsonPropertyAttributes()
|
||||
.IgnoreUnmatchedProperties()
|
||||
.Build();
|
||||
@@ -30,6 +31,7 @@ namespace k8s
|
||||
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
||||
.WithTypeConverter(new IntOrStringYamlConverter())
|
||||
.WithTypeConverter(new ByteArrayStringYamlConverter())
|
||||
.WithTypeConverter(new ResourceQuantityYamlConverter())
|
||||
.WithEventEmitter(e => new StringQuotingEmitter(e))
|
||||
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitNull)
|
||||
.WithOverridesFromJsonPropertyAttributes()
|
||||
|
||||
@@ -21,6 +21,9 @@ namespace LibKubernetesGenerator
|
||||
var swaggerfile = context.AdditionalFiles.First(f => f.Path.EndsWith("swagger.json"));
|
||||
var swagger = OpenApiDocument.FromJsonAsync(swaggerfile.GetText().ToString()).GetAwaiter().GetResult();
|
||||
|
||||
context.AnalyzerConfigOptions.GetOptions(swaggerfile).TryGetValue("build_metadata.AdditionalFiles.Generator", out var generatorSetting);
|
||||
var generators = new HashSet<string>(generatorSetting.Split(','));
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
|
||||
builder.RegisterType<ClassNameHelper>()
|
||||
@@ -78,15 +81,27 @@ namespace LibKubernetesGenerator
|
||||
}
|
||||
|
||||
|
||||
if (generators.Contains("api"))
|
||||
{
|
||||
container.Resolve<ApiGenerator>().Generate(swagger, context);
|
||||
}
|
||||
|
||||
if (generators.Contains("model"))
|
||||
{
|
||||
container.Resolve<ModelGenerator>().Generate(swagger, context);
|
||||
}
|
||||
|
||||
if (generators.Contains("modelext"))
|
||||
{
|
||||
container.Resolve<ModelExtGenerator>().Generate(swagger, context);
|
||||
}
|
||||
|
||||
if (generators.Contains("versionconverter"))
|
||||
{
|
||||
container.Resolve<VersionConverterGenerator>().Generate(swagger, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Execute(GeneratorExecutionContext context)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace k8s
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public partial interface IKubernetes
|
||||
public partial interface IBasicKubernetes
|
||||
{
|
||||
{{#.}}
|
||||
/// <summary>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace k8s
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public partial class Kubernetes : IKubernetes
|
||||
public partial class AbstractKubernetes : IBasicKubernetes
|
||||
{
|
||||
{{#.}}
|
||||
/// <inheritdoc/>
|
||||
@@ -46,9 +46,9 @@ namespace k8s
|
||||
{{/operation.parameters}}
|
||||
|
||||
// Construct URL
|
||||
var url = new System.Uri(BaseUri, $"{{ToInterpolationPathString path}}").ToString();
|
||||
var url = $"{{ToInterpolationPathString path}}";
|
||||
{{#IfGroupPathParamContainsGroup path}}
|
||||
url = url.Replace("/apis//", "/api/");
|
||||
url = url.Replace("apis//", "api/");
|
||||
{{/IfGroupPathParamContainsGroup}}
|
||||
var q = new QueryBuilder();
|
||||
{{#operation.parameters}}
|
||||
@@ -59,7 +59,7 @@ namespace k8s
|
||||
url += q.ToString();
|
||||
|
||||
// Create HTTP transport
|
||||
var httpRequest = CreateRequest(url, HttpMethod.{{Method}}, customHeaders);
|
||||
var httpRequest = CreateRequest(url, "{{Method}}", customHeaders);
|
||||
{{#IfParamContains operation "body"}}
|
||||
var httpResponse = await SendRequest(body, httpRequest, cancellationToken);
|
||||
{{/IfParamContains operation "body"}}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace k8s
|
||||
/// </param>
|
||||
{{/operation.parameters}}
|
||||
public static {{GetReturnType operation "void"}} {{GetMethodName operation ""}}(
|
||||
this IKubernetes operations
|
||||
this IBasicKubernetes operations
|
||||
{{#operation.parameters}}
|
||||
,{{GetDotNetType .}} {{GetDotNetName . "true"}}
|
||||
{{/operation.parameters}}
|
||||
@@ -58,7 +58,7 @@ namespace k8s
|
||||
/// A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
|
||||
/// </param>
|
||||
public static async Task{{GetReturnType operation "<>"}} {{GetMethodName operation "Async"}}(
|
||||
this IKubernetes operations,
|
||||
this IBasicKubernetes operations,
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetType .}} {{GetDotNetName . "true"}},
|
||||
{{/operation.parameters}}
|
||||
|
||||
8
src/nuget.proj
Normal file
8
src/nuget.proj
Normal file
@@ -0,0 +1,8 @@
|
||||
<Project Sdk="Microsoft.Build.Traversal">
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="KubernetesClient.Models/KubernetesClient.Models.csproj" />
|
||||
<ProjectReference Include="KubernetesClient.Basic/KubernetesClient.Basic.csproj" />
|
||||
<ProjectReference Include="KubernetesClient/KubernetesClient.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
using k8s.Tests.Mock;
|
||||
using k8s.Autorest;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using k8s.Tests.Mock;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace k8s.Tests
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
|
||||
"version": "7.1",
|
||||
"version": "7.2",
|
||||
"publicReleaseRefSpec": [
|
||||
"^refs/heads/master$",
|
||||
"^refs/tags/v\\d+\\.\\d+\\.\\d+"
|
||||
|
||||
Reference in New Issue
Block a user