Skip to content

Commit 0d719f1

Browse files
authored
7.1 remove old autorest (#785)
* init removal * clean up warning * bump ver to 7.1 * fix build * custom http client no long supported * cleanup unused types * fix npe * remove service client * modern ssl settings * fix test * fix client cert null * fix ctor * cleanup
1 parent ef7d226 commit 0d719f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+902
-585
lines changed

examples/attach/Attach.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
using System.Threading.Tasks;
33
using k8s;
44
using k8s.Models;
5-
using Microsoft.Rest;
5+
using k8s.Autorest;
66

77
namespace attach
88
{
99
internal class Attach
1010
{
1111
private static async Task Main(string[] args)
1212
{
13-
ServiceClientTracing.IsEnabled = true;
14-
1513
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
1614
IKubernetes client = new Kubernetes(config);
1715
Console.WriteLine("Starting Request!");

examples/customResource/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using k8s;
2+
using k8s.Autorest;
23
using k8s.Models;
34
using Microsoft.AspNetCore.JsonPatch;
45
using System;
@@ -35,14 +36,14 @@ private static async Task Main(string[] args)
3536
myCr.Metadata.NamespaceProperty ?? "default",
3637
myCRD.PluralName).ConfigureAwait(false);
3738
}
38-
catch (Microsoft.Rest.HttpOperationException httpOperationException) when (httpOperationException.Message.Contains("422"))
39+
catch (HttpOperationException httpOperationException) when (httpOperationException.Message.Contains("422"))
3940
{
4041
var phase = httpOperationException.Response.ReasonPhrase;
4142
var content = httpOperationException.Response.Content;
4243
Console.WriteLine("response content: {0}", content);
4344
Console.WriteLine("response phase: {0}", phase);
4445
}
45-
catch (Microsoft.Rest.HttpOperationException)
46+
catch (HttpOperationException)
4647
{
4748
}
4849

@@ -70,7 +71,7 @@ private static async Task Main(string[] args)
7071
myCRD.PluralName,
7172
myCr.Metadata.Name).ConfigureAwait(false);
7273
}
73-
catch (Microsoft.Rest.HttpOperationException httpOperationException)
74+
catch (HttpOperationException httpOperationException)
7475
{
7576
var phase = httpOperationException.Response.ReasonPhrase;
7677
var content = httpOperationException.Response.Content;

examples/httpClientFactory/PodListHostedService.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/httpClientFactory/Program.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/httpClientFactory/httpClientFactory.csproj

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/namespace/NamespaceExample.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ private static async Task DeleteAsync(IKubernetes client, string name, int delay
3535
{
3636
foreach (var innerEx in ex.InnerExceptions)
3737
{
38-
if (innerEx is Microsoft.Rest.HttpOperationException)
38+
if (innerEx is k8s.Autorest.HttpOperationException)
3939
{
40-
var code = ((Microsoft.Rest.HttpOperationException)innerEx).Response.StatusCode;
40+
var code = ((k8s.Autorest.HttpOperationException)innerEx).Response.StatusCode;
4141
if (code == HttpStatusCode.NotFound)
4242
{
4343
return;
@@ -47,7 +47,7 @@ private static async Task DeleteAsync(IKubernetes client, string name, int delay
4747
}
4848
}
4949
}
50-
catch (Microsoft.Rest.HttpOperationException ex)
50+
catch (k8s.Autorest.HttpOperationException ex)
5151
{
5252
if (ex.Response.StatusCode == HttpStatusCode.NotFound)
5353
{

examples/watch/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Threading.Tasks;
44
using k8s;
55
using k8s.Models;
6-
using Microsoft.Rest;
6+
using k8s.Autorest;
77

88
namespace watch
99
{

gen/LibKubernetesGenerator/LibKubernetesGenerator.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<LangVersion>10.0</LangVersion>
@@ -19,6 +19,7 @@
1919
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.0" GeneratePathProperty="true" PrivateAssets="all" />
2020
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" GeneratePathProperty="true" PrivateAssets="all" />
2121
<PackageReference Include="Namotion.Reflection" Version="2.0.9" GeneratePathProperty="true" PrivateAssets="all" />
22+
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.7.1" GeneratePathProperty="true" PrivateAssets="all" />
2223
</ItemGroup>
2324

2425
<PropertyGroup>
@@ -35,6 +36,7 @@
3536
<TargetPathWithTargetPlatformMoniker Include="$(PKGMicrosoft_Bcl_AsyncInterfaces)\lib\netstandard2.0\Microsoft.Bcl.AsyncInterfaces.dll" IncludeRuntimeDependency="false" />
3637
<TargetPathWithTargetPlatformMoniker Include="$(PKGNewtonsoft_Json)\lib\netstandard1.0\Newtonsoft.Json.dll" IncludeRuntimeDependency="false" />
3738
<TargetPathWithTargetPlatformMoniker Include="$(PKGNamotion_Reflection)\lib\netstandard2.0\Namotion.Reflection.dll" IncludeRuntimeDependency="false" />
39+
<TargetPathWithTargetPlatformMoniker Include="$(PKGSystem_Diagnostics_DiagnosticSource)\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll" IncludeRuntimeDependency="false" />
3840
</ItemGroup>
3941
</Target>
4042

gen/LibKubernetesGenerator/templates/IKubernetes.cs.template

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace k8s
88
{
9-
using Microsoft.Rest;
9+
using k8s.Autorest;
1010
using Models;
1111

1212
using System.Collections;
@@ -17,19 +17,8 @@ namespace k8s
1717

1818
/// <summary>
1919
/// </summary>
20-
public partial interface IKubernetes : System.IDisposable
20+
public partial interface IKubernetes
2121
{
22-
/// <summary>
23-
/// The base URI of the service.
24-
/// </summary>
25-
System.Uri BaseUri { get; set; }
26-
27-
/// <summary>
28-
/// Subscription credentials which uniquely identify client
29-
/// subscription.
30-
/// </summary>
31-
ServiceClientCredentials Credentials { get; }
32-
3322
{{#.}}
3423
/// <summary>
3524
/// {{ToXmlDoc operation.description}}

gen/LibKubernetesGenerator/templates/Kubernetes.cs.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace k8s
88
{
9-
using Microsoft.Rest;
9+
using k8s.Autorest;
1010
using Models;
1111
using System.Collections.Generic;
1212
using System.IO;
@@ -15,7 +15,7 @@ namespace k8s
1515
using System.Threading;
1616
using System.Threading.Tasks;
1717

18-
public partial class Kubernetes : ServiceClient<Kubernetes>, IKubernetes
18+
public partial class Kubernetes : IKubernetes
1919
{
2020
{{#.}}
2121
/// <inheritdoc/>

0 commit comments

Comments
 (0)