Skip to content

Gen v1.21.0 #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ jobs:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup dotnet SDK 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1.x'
- name: Setup dotnet SDK 3.1
uses: actions/setup-dotnet@v1
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
- uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup dotnet SDK 2.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: '2.1.x'
- name: Setup dotnet SDK 3.1
uses: actions/setup-dotnet@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>

<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
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.20.0
export KUBERNETES_BRANCH=v1.21.0
export CLIENT_VERSION=0.0.1
export PACKAGE_NAME=k8s
25 changes: 0 additions & 25 deletions src/KubernetesClient/Kubernetes.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,6 @@ protected async Task<WebSocket> StreamConnectAsync(Uri uri, string invocationId
}
}

#if (NETSTANDARD2_0)
if (this.CaCerts != null)
{
webSocketBuilder.SetServerCertificateValidationCallback(ServerCertificateValidationCallback);
}
#endif

#if NETSTANDARD2_1 || NET5_0
if (this.CaCerts != null)
{
webSocketBuilder.ExpectServerCertificate(this.CaCerts);
Expand All @@ -334,7 +326,6 @@ protected async Task<WebSocket> StreamConnectAsync(Uri uri, string invocationId
{
webSocketBuilder.Options.AddSubProtocol(webSocketSubProtocol);
}
#endif // NETSTANDARD2_1 || NET5_0

// Send Request
cancellationToken.ThrowIfCancellationRequested();
Expand Down Expand Up @@ -408,25 +399,9 @@ protected async Task<WebSocket> StreamConnectAsync(Uri uri, string invocationId
{
ServiceClientTracing.Exit(invocationId, null);
}

#if (NETSTANDARD2_0)
if (this.CaCerts != null)
{
webSocketBuilder.CleanupServerCertificateValidationCallback(
ServerCertificateValidationCallback);
}
#endif
}

return webSocket;
}

#if (NETSTANDARD2_0)
internal bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return CertificateValidationCallBack(sender, CaCerts, certificate, chain, sslPolicyErrors);
}
#endif
}
}
2 changes: 1 addition & 1 deletion src/KubernetesClient/KubernetesClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageIconUrl>https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png</PackageIconUrl>
<PackageTags>kubernetes;docker;containers;</PackageTags>

<TargetFrameworks>netstandard2.0;netstandard2.1;net5</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5</TargetFrameworks>
<RootNamespace>k8s</RootNamespace>
<SignAssembly>true</SignAssembly>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
12 changes: 10 additions & 2 deletions src/KubernetesClient/Versioning/VersionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ private static void ManualConfigurations(IMapperConfigurationExpression cfg)
obj.Kind = metadata.Kind;
});
});
cfg.CreateMap<V1Subject, Rbacv1alpha1Subject>()
cfg.CreateMap<V1Subject, V1alpha1Subject>()
.ForMember(dest => dest.ApiVersion, opt => opt.Ignore())
.ReverseMap();
cfg.CreateMap<Rbacv1beta1Subject, Rbacv1alpha1Subject>()
cfg.CreateMap<Rbacv1beta1Subject, V1alpha1Subject>()
.ForMember(dest => dest.ApiVersion, opt => opt.Ignore())
.ReverseMap();
cfg.CreateMap<V1Subject, Rbacv1beta1Subject>()
Expand Down Expand Up @@ -447,6 +447,14 @@ private static void ManualConfigurations(IMapperConfigurationExpression cfg)
cfg.CreateMap<V1alpha1ClusterRoleBindingList, V1beta1ClusterRoleBindingList>().ReverseMap();
cfg.CreateMap<V1alpha1ClusterRoleBindingList, V1ClusterRoleBindingList>().ReverseMap();
cfg.CreateMap<V1beta1ClusterRoleBindingList, V1ClusterRoleBindingList>().ReverseMap();

cfg.CreateMap<V1beta1Endpoint, V1Endpoint>()
.ForMember(dest => dest.DeprecatedTopology, opt => opt.Ignore())
.ForMember(dest => dest.Zone, opt => opt.Ignore())
.ReverseMap();

cfg.CreateMap<V1beta1EndpointPort, Discoveryv1EndpointPort>()
.ReverseMap();
}
}
}
2 changes: 0 additions & 2 deletions src/KubernetesClient/WatcherDelegatingHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ protected override async Task<HttpResponseMessage> SendAsync(
HttpRequestMessage request,
CancellationToken cancellationToken)
{
#if NET5_0 || NETSTANDARD2_1
request.Version = HttpVersion.Version20;
#endif
var originResponse = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);

// all watches are GETs, so we can ignore others
Expand Down
17 changes: 0 additions & 17 deletions src/KubernetesClient/WebSocketBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ public virtual WebSocketBuilder AddClientCertificate(X509Certificate2 certificat
return this;
}

#if (NETSTANDARD2_0)
public WebSocketBuilder SetServerCertificateValidationCallback(
RemoteCertificateValidationCallback validationCallback)
{
System.Net.ServicePointManager.ServerCertificateValidationCallback += validationCallback;
return this;
}

public void CleanupServerCertificateValidationCallback(RemoteCertificateValidationCallback validationCallback)
{
System.Net.ServicePointManager.ServerCertificateValidationCallback -= validationCallback;
}
#endif

#if NETSTANDARD2_1 || NET5_0
public WebSocketBuilder ExpectServerCertificate(X509Certificate2Collection serverCertificate)
{
Options.RemoteCertificateValidationCallback
Expand All @@ -70,8 +55,6 @@ public WebSocketBuilder SkipServerCertificateValidation()
return this;
}

#endif // NETSTANDARD2_1 || NET5_0

public virtual async Task<WebSocket> BuildAndConnectAsync(Uri uri, CancellationToken cancellationToken)
{
await WebSocket.ConnectAsync(uri, cancellationToken).ConfigureAwait(false);
Expand Down
Loading