generate v1.26 (#1122)
* update swagger * remove unused models in converter * remove netcore3.1 from testr * bump ver * fix convert * remove some unused autorest property * move some clz from autorest to client * fix import * no longer expose SendRequestRaw * make file utils inner * fix build * c# 11
This commit is contained in:
2
.github/workflows/buildtest.yaml
vendored
2
.github/workflows/buildtest.yaml
vendored
@@ -15,7 +15,6 @@ jobs:
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: |
|
||||
3.1.x
|
||||
6.0.x
|
||||
7.0.x
|
||||
# - name: Check Format
|
||||
@@ -56,7 +55,6 @@ jobs:
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: |
|
||||
3.1.x
|
||||
6.0.x
|
||||
7.0.x
|
||||
- name: Minikube
|
||||
|
||||
1
.github/workflows/docfx.yaml
vendored
1
.github/workflows/docfx.yaml
vendored
@@ -33,7 +33,6 @@ jobs:
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: |
|
||||
3.1.x
|
||||
5.0.x
|
||||
6.0.x
|
||||
|
||||
|
||||
1
.github/workflows/draft.yaml
vendored
1
.github/workflows/draft.yaml
vendored
@@ -18,7 +18,6 @@ jobs:
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: |
|
||||
3.1.x
|
||||
6.0.x
|
||||
7.0.x
|
||||
|
||||
|
||||
1
.github/workflows/nuget.yaml
vendored
1
.github/workflows/nuget.yaml
vendored
@@ -18,7 +18,6 @@ jobs:
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: |
|
||||
3.1.x
|
||||
6.0.x
|
||||
7.0.x
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
|
||||
@@ -149,6 +149,7 @@ ${GEN_DIR}/openapi/csharp.sh ${REPO_DIR}/src/KubernetesClient ${REPO_DIR}/csharp
|
||||
|
||||
| SDK Version | Kubernetes Version | .NET Targeting |
|
||||
|-------------|--------------------|------------------------------------------------------|
|
||||
| 10.0 | 1.26 | net6.0;net7.0;net48*;netstandard2.0* |
|
||||
| 9.1 | 1.25 | netstandard2.1;net6.0;net7.0;net48*;netstandard2.0* |
|
||||
| 9.0 | 1.25 | netstandard2.1;net5.0;net6.0;net48*;netstandard2.0* |
|
||||
| 8.0 | 1.24 | netstandard2.1;net5.0;net6.0;net48*;netstandard2.0* |
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export KUBERNETES_BRANCH=v1.25.0
|
||||
export KUBERNETES_BRANCH=v1.26.0
|
||||
export CLIENT_VERSION=0.0.1
|
||||
export PACKAGE_NAME=k8s
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using k8s;
|
||||
using k8s.Monitoring;
|
||||
using Prometheus;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
|
||||
@@ -14,7 +14,13 @@ public abstract partial class AbstractKubernetes
|
||||
public static readonly HttpMethod Post = HttpMethod.Post;
|
||||
public static readonly HttpMethod Put = HttpMethod.Put;
|
||||
public static readonly HttpMethod Trace = HttpMethod.Trace;
|
||||
|
||||
#if NETSTANDARD2_0
|
||||
public static readonly HttpMethod Patch = new HttpMethod("PATCH");
|
||||
#else
|
||||
public static readonly HttpMethod Patch = HttpMethod.Patch;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
private sealed class QueryBuilder
|
||||
@@ -96,6 +102,4 @@ public abstract partial class AbstractKubernetes
|
||||
protected abstract Task<HttpOperationResponse<T>> CreateResultAsync<T>(HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, bool? watch, CancellationToken cancellationToken);
|
||||
|
||||
protected abstract Task<HttpResponseMessage> SendRequest<T>(string relativeUri, HttpMethod method, IReadOnlyDictionary<string, IReadOnlyList<string>> customHeaders, T body, CancellationToken cancellationToken);
|
||||
|
||||
protected abstract Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace k8s.Autorest
|
||||
/// Exception thrown for an invalid response with custom error information.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class HttpOperationException : RestException
|
||||
public class HttpOperationException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets information about the associated HTTP request.
|
||||
|
||||
@@ -24,20 +24,12 @@ namespace k8s.Autorest
|
||||
throw new ArgumentNullException("httpRequest");
|
||||
}
|
||||
|
||||
this.CopyHeaders(httpRequest.Headers);
|
||||
this.CopyHeaders(httpRequest.GetContentHeaders());
|
||||
CopyHeaders(httpRequest.Headers);
|
||||
CopyHeaders(httpRequest.GetContentHeaders());
|
||||
|
||||
this.Content = content;
|
||||
this.Method = httpRequest.Method;
|
||||
this.RequestUri = httpRequest.RequestUri;
|
||||
if (httpRequest.Properties != null)
|
||||
{
|
||||
Properties = new Dictionary<string, object>();
|
||||
foreach (KeyValuePair<string, object> pair in httpRequest.Properties)
|
||||
{
|
||||
this.Properties[pair.Key] = pair.Value;
|
||||
}
|
||||
}
|
||||
Content = content;
|
||||
Method = httpRequest.Method;
|
||||
RequestUri = httpRequest.RequestUri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -49,10 +41,5 @@ namespace k8s.Autorest
|
||||
/// Gets or sets the Uri used for the HTTP request.
|
||||
/// </summary>
|
||||
public Uri RequestUri { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a set of properties for the HTTP request.
|
||||
/// </summary>
|
||||
public IDictionary<string, object> Properties { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ namespace k8s.Autorest
|
||||
throw new ArgumentNullException("httpResponse");
|
||||
}
|
||||
|
||||
this.CopyHeaders(httpResponse.Headers);
|
||||
this.CopyHeaders(httpResponse.GetContentHeaders());
|
||||
CopyHeaders(httpResponse.Headers);
|
||||
CopyHeaders(httpResponse.GetContentHeaders());
|
||||
|
||||
this.Content = content;
|
||||
this.StatusCode = httpResponse.StatusCode;
|
||||
this.ReasonPhrase = httpResponse.ReasonPhrase;
|
||||
Content = content;
|
||||
StatusCode = httpResponse.StatusCode;
|
||||
ReasonPhrase = httpResponse.ReasonPhrase;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace k8s.Autorest
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic exception for Microsoft Rest Client.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RestException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RestException"/> class.
|
||||
/// </summary>
|
||||
public RestException()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RestException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">The exception message.</param>
|
||||
public RestException(string message)
|
||||
: this(message, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RestException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">The exception message.</param>
|
||||
/// <param name="innerException">Inner exception.</param>
|
||||
public RestException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RestException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="info">Serialization info.</param>
|
||||
/// <param name="context">Streaming context.</param>
|
||||
protected RestException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
3
src/KubernetesClient.Classic/AssemblyInfo.cs
Normal file
3
src/KubernetesClient.Classic/AssemblyInfo.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("KubernetesClient.Tests")]
|
||||
@@ -50,6 +50,11 @@
|
||||
<Compile Include="..\KubernetesClient\Authentication\GcpTokenProvider.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\OidcTokenProvider.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\TokenFileAuth.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\BasicAuthenticationCredentials.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\ITokenProvider.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\ServiceClientCredentials.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\StringTokenProvider.cs" />
|
||||
<Compile Include="..\KubernetesClient\Authentication\TokenCredentials.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -148,21 +148,17 @@ namespace k8s.Versioning
|
||||
obj.Kind = metadata.Kind;
|
||||
});
|
||||
});
|
||||
cfg.CreateMap<V1Subject, V1beta1Subject>()
|
||||
.ForMember(dest => dest.Group, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.ServiceAccount, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.User, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
|
||||
cfg.CreateMap<V1Subject, V1beta2Subject>()
|
||||
.ForMember(dest => dest.Group, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.ServiceAccount, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.User, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
|
||||
|
||||
cfg.CreateMap<V1HorizontalPodAutoscalerSpec, V2beta2HorizontalPodAutoscalerSpec>()
|
||||
.ForMember(dest => dest.Metrics, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.Behavior, opt => opt.Ignore())
|
||||
cfg.CreateMap<V1Subject, V1beta3Subject>()
|
||||
.ForMember(dest => dest.Group, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.ServiceAccount, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.User, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
|
||||
cfg.CreateMap<V1HorizontalPodAutoscalerSpec, V2HorizontalPodAutoscalerSpec>()
|
||||
@@ -171,14 +167,18 @@ namespace k8s.Versioning
|
||||
.ReverseMap();
|
||||
|
||||
|
||||
cfg.CreateMap<V1HorizontalPodAutoscalerStatus, V2beta2HorizontalPodAutoscalerStatus>()
|
||||
.ForMember(dest => dest.Conditions, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.CurrentMetrics, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
cfg.CreateMap<V1HorizontalPodAutoscalerStatus, V2HorizontalPodAutoscalerStatus>()
|
||||
.ForMember(dest => dest.Conditions, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.CurrentMetrics, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
|
||||
cfg.CreateMap<V1alpha1ResourceClaim, V1ResourceClaim>()
|
||||
.ForMember(dest => dest.Name, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
|
||||
cfg.CreateMap<V1beta2LimitedPriorityLevelConfiguration, V1beta3LimitedPriorityLevelConfiguration>()
|
||||
.ForMember(dest => dest.NominalConcurrencyShares, opt => opt.Ignore())
|
||||
.ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,10 @@ using System.Globalization;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Autorest
|
||||
namespace k8s.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic Auth credentials for use with a REST Service Client.
|
||||
@@ -1,4 +1,3 @@
|
||||
using k8s.Autorest;
|
||||
using k8s.KubeConfigModels;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using k8s.Autorest;
|
||||
using k8s.Exceptions;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#pragma warning disable SA1606
|
||||
#pragma warning disable SA1614
|
||||
namespace k8s.Autorest
|
||||
namespace k8s.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface to a source of access tokens.
|
||||
@@ -1,5 +1,4 @@
|
||||
using IdentityModel.OidcClient;
|
||||
using k8s.Autorest;
|
||||
using k8s.Exceptions;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Net.Http.Headers;
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Autorest
|
||||
namespace k8s.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// ServiceClientCredentials is the abstraction for credentials used by ServiceClients accessing REST services.
|
||||
@@ -2,8 +2,10 @@
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Autorest
|
||||
namespace k8s.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// A simple token provider that always provides a static access token.
|
||||
@@ -2,8 +2,10 @@
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Autorest
|
||||
namespace k8s.Authentication
|
||||
{
|
||||
/// <summary>
|
||||
/// Token based credentials for use with a REST Service Client.
|
||||
@@ -73,7 +75,7 @@ namespace k8s.Autorest
|
||||
throw new ArgumentNullException("tokenProvider");
|
||||
}
|
||||
|
||||
this.TokenProvider = tokenProvider;
|
||||
TokenProvider = tokenProvider;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -86,8 +88,8 @@ namespace k8s.Autorest
|
||||
public TokenCredentials(ITokenProvider tokenProvider, string tenantId, string callerId)
|
||||
: this(tokenProvider)
|
||||
{
|
||||
this.TenantId = tenantId;
|
||||
this.CallerId = callerId;
|
||||
TenantId = tenantId;
|
||||
CallerId = callerId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1,4 +1,3 @@
|
||||
using k8s.Autorest;
|
||||
using System.IO;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.IO.Abstractions;
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
public static class FileUtils
|
||||
internal static class FileUtils
|
||||
{
|
||||
private static readonly IFileSystem RealFileSystem = new FileSystem();
|
||||
private static IFileSystem currentFileSystem = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using k8s.Autorest;
|
||||
using k8s.Authentication;
|
||||
using k8s.Exceptions;
|
||||
using System.Net.Http;
|
||||
using System.Net.Security;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using k8s.Authentication;
|
||||
using k8s.Autorest;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
@@ -138,7 +139,7 @@ namespace k8s
|
||||
return SendRequestRaw("", httpRequest, cancellationToken);
|
||||
}
|
||||
|
||||
protected override async Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
protected virtual async Task<HttpResponseMessage> SendRequestRaw(string requestContent, HttpRequestMessage httpRequest, CancellationToken cancellationToken)
|
||||
{
|
||||
if (httpRequest == null)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.1;net6.0;net7.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
<RootNamespace>k8s</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.25.1" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="18.0.1" />
|
||||
<PackageReference Include="IdentityModel.OidcClient" Version="5.2.0" />
|
||||
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" Condition="'$(TargetFramework)' == 'netstandard2.1'" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using k8s.Autorest;
|
||||
using k8s.Authentication;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Monitoring
|
||||
namespace k8s
|
||||
{
|
||||
public class PrometheusHandler : DelegatingHandler
|
||||
{
|
||||
|
||||
13592
swagger.json
13592
swagger.json
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<RootNamespace>k8s.E2E</RootNamespace>
|
||||
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
<RootNamespace>k8s.Tests</RootNamespace>
|
||||
<TargetFrameworks>netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using k8s.Autorest;
|
||||
using k8s.Authentication;
|
||||
using k8s.Tests.Logging;
|
||||
using k8s.Tests.Mock.Server;
|
||||
using Microsoft.AspNetCore;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
|
||||
"version": "9.1",
|
||||
"version": "10.0",
|
||||
"publicReleaseRefSpec": [
|
||||
"^refs/heads/master$",
|
||||
"^refs/tags/v\\d+\\.\\d+\\.\\d+"
|
||||
|
||||
Reference in New Issue
Block a user