Skip to content

Commit

Permalink
embed KubernetesClient.Models and KubernetesClient.Basic into client …
Browse files Browse the repository at this point in the history
…sdk (#1407)

* cleanup using

* cleanup classic

* clean up nuget

* bump ver

* fix pipeline

* remove commit by accident
  • Loading branch information
tg123 authored Sep 26, 2023
1 parent 80c1315 commit 013fc6e
Show file tree
Hide file tree
Showing 59 changed files with 172 additions and 220 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
with:
dotnet-version: '7.0.x'
- name: Restore nugets (msbuild)
run: msbuild .\src\KubernetesClient.Models\ -t:restore -p:RestorePackagesConfig=true
run: msbuild .\src\KubernetesClient\ -t:restore -p:RestorePackagesConfig=true
- name: Build (msbuild)
run: msbuild .\src\KubernetesClient.Models\
run: msbuild .\src\KubernetesClient\

e2e:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ jobs:
matrix:
nuget-package:
- "KubernetesClient"
- "KubernetesClient.Models"
- "KubernetesClient.Basic"
- "KubernetesClient.Classic"
runs-on: ubuntu-latest
permissions:
Expand Down
30 changes: 0 additions & 30 deletions kubernetes-client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ 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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.Basic", "src\KubernetesClient.Basic\KubernetesClient.Basic.csproj", "{927995F5-05CC-4078-8805-8E6CC06914D8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.Classic", "src\KubernetesClient.Classic\KubernetesClient.Classic.csproj", "{80F19E8A-F097-4AA4-A68C-D417B96BBC68}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.Classic.Tests", "tests\KubernetesClient.Classic.Tests\KubernetesClient.Classic.Tests.csproj", "{FD90C861-56C6-4536-B7F5-AC7779296384}"
Expand Down Expand Up @@ -311,30 +307,6 @@ 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
{80F19E8A-F097-4AA4-A68C-D417B96BBC68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80F19E8A-F097-4AA4-A68C-D417B96BBC68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80F19E8A-F097-4AA4-A68C-D417B96BBC68}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -491,8 +463,6 @@ 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}
{80F19E8A-F097-4AA4-A68C-D417B96BBC68} = {3D1864AA-1FFC-4512-BB13-46055E410F73}
{FD90C861-56C6-4536-B7F5-AC7779296384} = {8AF4A5C2-F0CE-47D5-A4C5-FE4AB83CA509}
{F626860C-F141-45B3-9DDD-88AD3932ACAF} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
Expand Down
2 changes: 1 addition & 1 deletion src/KubernetesClient.Basic/AbstractKubernetes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private static class HttpMethods
public static readonly HttpMethod Put = HttpMethod.Put;
public static readonly HttpMethod Trace = HttpMethod.Trace;

#if NETSTANDARD2_0
#if NETSTANDARD2_0 || NET48
public static readonly HttpMethod Patch = new HttpMethod("PATCH");
#else
public static readonly HttpMethod Patch = HttpMethod.Patch;
Expand Down
18 changes: 0 additions & 18 deletions src/KubernetesClient.Basic/KubernetesClient.Basic.csproj

This file was deleted.

1 change: 0 additions & 1 deletion src/KubernetesClient.Classic/CertUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.X509;
using System.IO;
using System.Security.Cryptography.X509Certificates;

namespace k8s
Expand Down
5 changes: 5 additions & 0 deletions src/KubernetesClient.Classic/Global.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
global using k8s.Autorest;
global using k8s.Models;
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Text.Json;
global using System.Text.Json.Serialization;
global using System.Threading;
global using System.Threading.Tasks;
77 changes: 72 additions & 5 deletions src/KubernetesClient.Classic/KubernetesClient.Classic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,70 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.0" />
<PackageReference Include="IdentityModel.OidcClient" Version="5.2.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="Fractions" Version="7.2.1" />
<PackageReference Include="YamlDotNet" Version="13.3.1" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" />
<ProjectReference Include="..\KubernetesClient.Basic\KubernetesClient.Basic.csproj" />
<Compile Include="..\KubernetesClient.Models\ContainerMetrics.cs" />
<Compile Include="..\KubernetesClient.Models\Extensions.cs" />
<Compile Include="..\KubernetesClient.Models\FloatEmitter.cs" />
<Compile Include="..\KubernetesClient.Models\GeneratedModelVersion.cs" />
<Compile Include="..\KubernetesClient.Models\IItems.cs" />
<Compile Include="..\KubernetesClient.Models\IKubernetesObject.cs" />
<Compile Include="..\KubernetesClient.Models\IMetadata.cs" />
<Compile Include="..\KubernetesClient.Models\IntOrStringJsonConverter.cs" />
<Compile Include="..\KubernetesClient.Models\IntOrStringYamlConverter.cs" />
<Compile Include="..\KubernetesClient.Models\IntstrIntOrString.cs" />
<Compile Include="..\KubernetesClient.Models\ISpec.cs" />
<Compile Include="..\KubernetesClient.Models\IStatus.cs" />
<Compile Include="..\KubernetesClient.Models\IValidate.cs" />
<Compile Include="..\KubernetesClient.Models\KubernetesEntityAttribute.cs" />
<Compile Include="..\KubernetesClient.Models\KubernetesJson.cs" />
<Compile Include="..\KubernetesClient.Models\KubernetesList.cs" />
<Compile Include="..\KubernetesClient.Models\KubernetesObject.cs" />
<Compile Include="..\KubernetesClient.Models\KubernetesYaml.cs" />
<Compile Include="..\KubernetesClient.Models\ModelExtensions.cs" />
<Compile Include="..\KubernetesClient.Models\ModelVersionConverter.cs" />
<Compile Include="..\KubernetesClient.Models\NodeMetrics.cs" />
<Compile Include="..\KubernetesClient.Models\NodeMetricsList.cs" />
<Compile Include="..\KubernetesClient.Models\PodMetrics.cs" />
<Compile Include="..\KubernetesClient.Models\PodMetricsList.cs" />
<Compile Include="..\KubernetesClient.Models\ResourceQuantity.cs" />
<Compile Include="..\KubernetesClient.Models\ResourceQuantityJsonConverter.cs" />
<Compile Include="..\KubernetesClient.Models\ResourceQuantityYamlConverter.cs" />
<Compile Include="..\KubernetesClient.Models\StringQuotingEmitter.cs" />
<Compile Include="..\KubernetesClient.Models\V1Patch.cs" />
<Compile Include="..\KubernetesClient.Models\V1PatchJsonConverter.cs" />
<Compile Include="..\KubernetesClient.Models\V1PodTemplateSpec.cs" />
<Compile Include="..\KubernetesClient.Models\V1Status.cs" />
<Compile Include="..\KubernetesClient.Models\V1Status.ObjectView.cs" />


<Compile Include="..\KubernetesClient.Models\KubeConfigModels\ClusterEndpoint.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\Context.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\ContextDetails.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\ExecCredentialResponse.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\ExternalExecution.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\K8SConfiguration.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\NamedExtension.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\User.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\UserCredentials.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\Cluster.cs" />
<Compile Include="..\KubernetesClient.Models\KubeConfigModels\AuthProvider.cs" />

</ItemGroup>
<ItemGroup>
<Compile Include="..\KubernetesClient.Basic\AbstractKubernetes.cs" />
<Compile Include="..\KubernetesClient.Basic\GeneratedApiVersion.cs" />

<Compile Include="..\KubernetesClient.Basic\Autorest\HttpExtensions.cs" />
<Compile Include="..\KubernetesClient.Basic\Autorest\HttpMessageWrapper.cs" />
<Compile Include="..\KubernetesClient.Basic\Autorest\HttpOperationException.cs" />
<Compile Include="..\KubernetesClient.Basic\Autorest\HttpOperationResponse.cs" />
<Compile Include="..\KubernetesClient.Basic\Autorest\HttpRequestMessageWrapper.cs" />
<Compile Include="..\KubernetesClient.Basic\Autorest\HttpResponseMessageWrapper.cs" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -59,8 +118,16 @@
<Compile Include="..\KubernetesClient\Authentication\StringTokenProvider.cs" />
<Compile Include="..\KubernetesClient\Authentication\TokenCredentials.cs" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Net.Http" Condition="'$(TargetFramework)' == 'net48'" />
</ItemGroup>
</Project>

<ItemGroup>
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="Generator" />
<AdditionalFiles Include="..\..\swagger.json"
Generator="model,modelext,api,version,versionconverterstub" />
<ProjectReference Include="..\LibKubernetesGenerator\LibKubernetesGenerator.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\KubernetesClient.Models\KubernetesClient.Models.csproj" />
<ProjectReference Include="..\KubernetesClient\KubernetesClient.csproj" />
<PackageReference Include="AutoMapper" Version="12.0.1" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion src/KubernetesClient.Models/Extensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using k8s.Models;
using System.Reflection;
using System.Text.RegularExpressions;

Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient.Models/IMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using k8s.Models;

namespace k8s
{
/// <summary>
Expand Down
18 changes: 0 additions & 18 deletions src/KubernetesClient.Models/KubernetesClient.Models.csproj

This file was deleted.

2 changes: 0 additions & 2 deletions src/KubernetesClient.Models/KubernetesJson.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using k8s.Models;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;

Expand Down
3 changes: 0 additions & 3 deletions src/KubernetesClient.Models/KubernetesYaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using k8s.Models;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Serialization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace k8s.Authentication
{
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/ExecTokenProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using k8s.KubeConfigModels;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

namespace k8s.Authentication
{
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/GcpTokenProvider.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using k8s.Exceptions;
using System.Diagnostics;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

namespace k8s.Authentication
{
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/ITokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/OidcTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using k8s.Exceptions;
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

namespace k8s.Authentication
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.Authentication
{
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/StringTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.Authentication
{
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/Authentication/TokenCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// 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.Authentication
{
Expand Down
3 changes: 0 additions & 3 deletions src/KubernetesClient/Authentication/TokenFileAuth.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System.IO;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;

namespace k8s.Authentication
{
Expand Down
1 change: 0 additions & 1 deletion src/KubernetesClient/ByteBuffer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.Buffers;
using System.Diagnostics;
using System.Threading;

namespace k8s
{
Expand Down
3 changes: 1 addition & 2 deletions src/KubernetesClient/CertUtils.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using k8s.Exceptions;
using System.Runtime.InteropServices;
using System.Text;
using System.IO;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace k8s
{
Expand Down
3 changes: 0 additions & 3 deletions src/KubernetesClient/ExecAsyncCallback.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System.IO;
using System.Threading.Tasks;

namespace k8s
{
/// <summary>
Expand Down
2 changes: 0 additions & 2 deletions src/KubernetesClient/FileSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.IO;

namespace k8s
{
internal static class FileSystem
Expand Down
5 changes: 0 additions & 5 deletions src/KubernetesClient/GenericClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using k8s.Models;
using System.Threading;
using System.Threading.Tasks;


namespace k8s
{
public class GenericClient : IDisposable
Expand Down
5 changes: 5 additions & 0 deletions src/KubernetesClient/Global.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
global using k8s.Autorest;
global using k8s.Models;
global using System;
global using System.Collections.Generic;
global using System.IO;
global using System.Linq;
global using System.Text.Json;
global using System.Text.Json.Serialization;
global using System.Threading;
global using System.Threading.Tasks;
Loading

0 comments on commit 013fc6e

Please sign in to comment.