diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index c23aa96..b3780fb 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -16,8 +16,8 @@ jobs: with: dotnet-version: | 3.1.x - 5.0.x - 6.0.x + 6.0.x + 7.0.x # - name: Check Format # # don't check formatting on Windows b/c of CRLF issues. # if: matrix.os == 'ubuntu-latest' @@ -37,10 +37,10 @@ jobs: fetch-depth: 0 - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - - name: Setup dotnet SDK 6 + - name: Setup dotnet SDK 7 uses: actions/setup-dotnet@v3 with: - dotnet-version: '6.0.x' + dotnet-version: '7.0.x' - name: Restore nugets (msbuild) run: msbuild .\src\KubernetesClient.Models\ -t:restore -p:RestorePackagesConfig=true - name: Build (msbuild) @@ -57,8 +57,8 @@ jobs: with: dotnet-version: | 3.1.x - 5.0.x - 6.0.x + 6.0.x + 7.0.x - name: Minikube run: minikube start - name: Test diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b1a19e3..31df770 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,8 +30,8 @@ jobs: with: dotnet-version: | 3.1.x - 5.0.x - 6.0.x + 6.0.x + 7.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/draft.yaml b/.github/workflows/draft.yaml index 21863b8..6097e72 100644 --- a/.github/workflows/draft.yaml +++ b/.github/workflows/draft.yaml @@ -19,8 +19,8 @@ jobs: with: dotnet-version: | 3.1.x - 5.0.x - 6.0.x + 6.0.x + 7.0.x - name: dotnet restore run: dotnet restore --verbosity minimal --configfile nuget.config diff --git a/.github/workflows/nuget.yaml b/.github/workflows/nuget.yaml index 4d5d248..b3ed47e 100644 --- a/.github/workflows/nuget.yaml +++ b/.github/workflows/nuget.yaml @@ -19,8 +19,8 @@ jobs: with: dotnet-version: | 3.1.x - 5.0.x - 6.0.x + 6.0.x + 7.0.x - name: dotnet restore run: dotnet restore --verbosity minimal --configfile nuget.config diff --git a/Directory.Build.targets b/Directory.Build.targets index f88121b..d8ab7be 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,7 +1,7 @@ - + diff --git a/README.md b/README.md index 3a060c8..bbfa3aa 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ ${GEN_DIR}/openapi/csharp.sh ${REPO_DIR}/src/KubernetesClient ${REPO_DIR}/csharp | SDK Version | Kubernetes Version | .NET Targeting | |-------------|--------------------|------------------------------------------------------| +| 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* | | 7.2 | 1.23 | netstandard2.1;net5.0;net6.0;net48*;netstandard2.0* | diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props index ab4d8e7..609159b 100644 --- a/examples/Directory.Build.props +++ b/examples/Directory.Build.props @@ -1,6 +1,6 @@ - net6.0 + net7.0 diff --git a/global.json b/global.json index 7d31d2f..e1538be 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "6.0.400", + "version": "7.0.100", "rollForward": "latestMajor" }, "msbuild-sdks": { diff --git a/src/KubernetesClient.Basic/KubernetesClient.Basic.csproj b/src/KubernetesClient.Basic/KubernetesClient.Basic.csproj index 353630c..e0f9230 100644 --- a/src/KubernetesClient.Basic/KubernetesClient.Basic.csproj +++ b/src/KubernetesClient.Basic/KubernetesClient.Basic.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + netstandard2.0;net6.0;net7.0 k8s diff --git a/src/KubernetesClient.Kubectl/KubernetesClient.Kubectl.csproj b/src/KubernetesClient.Kubectl/KubernetesClient.Kubectl.csproj index 794a3d8..21e1d2b 100644 --- a/src/KubernetesClient.Kubectl/KubernetesClient.Kubectl.csproj +++ b/src/KubernetesClient.Kubectl/KubernetesClient.Kubectl.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0 enable enable k8s.kubectl diff --git a/src/KubernetesClient.Models/KubernetesClient.Models.csproj b/src/KubernetesClient.Models/KubernetesClient.Models.csproj index 7610e5e..733e550 100644 --- a/src/KubernetesClient.Models/KubernetesClient.Models.csproj +++ b/src/KubernetesClient.Models/KubernetesClient.Models.csproj @@ -1,6 +1,6 @@ - netstandard2.0 + netstandard2.0;net6.0;net7.0 k8s.Models @@ -12,7 +12,8 @@ - + + diff --git a/src/KubernetesClient.Models/Versioning/VersionConverter.cs b/src/KubernetesClient.Models/Versioning/VersionConverter.cs index 8c2c5ce..fd064f3 100644 --- a/src/KubernetesClient.Models/Versioning/VersionConverter.cs +++ b/src/KubernetesClient.Models/Versioning/VersionConverter.cs @@ -1,6 +1,9 @@ // WARNING: DO NOT LEAVE COMMENTED CODE IN THIS FILE. IT GETS SCANNED BY GEN PROJECT SO IT CAN EXCLUDE ANY MANUALLY DEFINED MAPS using AutoMapper; +#if NET6_0_OR_GREATER +using AutoMapper.Internal; +#endif using k8s.Models; using System.Reflection; @@ -41,8 +44,15 @@ namespace k8s.Versioning GetConfigurations(cfg); configuration(cfg); }); - Mapper = MapperConfiguration.CreateMapper(); + Mapper = MapperConfiguration +#if NET6_0_OR_GREATER + .Internal() +#endif + .CreateMapper(); KindVersionsMap = MapperConfiguration +#if NET6_0_OR_GREATER + .Internal() +#endif .GetAllTypeMaps() .SelectMany(x => new[] { x.Types.SourceType, x.Types.DestinationType }) .Where(x => x.GetCustomAttribute() != null) @@ -78,7 +88,12 @@ namespace k8s.Versioning throw new InvalidOperationException($"Version converter does not have any registered types for Kind `{attr.Kind}`"); } - if (!kindVersions.TryGetValue(apiVersion, out var targetType) || !kindVersions.TryGetValue(attr.ApiVersion, out var sourceType) || MapperConfiguration.FindTypeMapFor(sourceType, targetType) == null) + if (!kindVersions.TryGetValue(apiVersion, out var targetType) || !kindVersions.TryGetValue(attr.ApiVersion, out var sourceType) || + MapperConfiguration +#if NET6_0_OR_GREATER + .Internal() +#endif + .FindTypeMapFor(sourceType, targetType) == null) { throw new InvalidOperationException($"There is no conversion mapping registered for Kind `{attr.Kind}` from ApiVersion {attr.ApiVersion} to {apiVersion}"); } @@ -112,7 +127,11 @@ namespace k8s.Versioning { cfg.AllowNullCollections = true; cfg.DisableConstructorMapping(); - cfg.ForAllMaps((typeMap, opt) => + cfg +#if NET6_0_OR_GREATER + .Internal() +#endif + .ForAllMaps((typeMap, opt) => { if (!typeof(IKubernetesObject).IsAssignableFrom(typeMap.Types.DestinationType)) { diff --git a/src/KubernetesClient/Kubernetes.ConfigInit.cs b/src/KubernetesClient/Kubernetes.ConfigInit.cs index e98678b..be9d062 100644 --- a/src/KubernetesClient/Kubernetes.ConfigInit.cs +++ b/src/KubernetesClient/Kubernetes.ConfigInit.cs @@ -92,6 +92,13 @@ namespace k8s { #if NET5_0_OR_GREATER HttpClientHandler.SslOptions.ClientCertificates.Add(clientCert); + + // TODO this is workaround for net7.0, remove it when the issue is fixed + // seems the client certificate is cached and cannot be updated + HttpClientHandler.SslOptions.LocalCertificateSelectionCallback = (sender, targetHost, localCertificates, remoteCertificate, acceptableIssuers) => + { + return clientCert; + }; #else HttpClientHandler.ClientCertificates.Add(clientCert); #endif diff --git a/src/KubernetesClient/KubernetesClient.csproj b/src/KubernetesClient/KubernetesClient.csproj index e7b869e..964df37 100644 --- a/src/KubernetesClient/KubernetesClient.csproj +++ b/src/KubernetesClient/KubernetesClient.csproj @@ -1,7 +1,7 @@ - netstandard2.1;net5.0;net6.0 + netstandard2.1;net6.0;net7.0 k8s diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index dbb45ee..9f986cb 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -3,7 +3,7 @@ false true k8s.E2E - netcoreapp3.1;net5.0;net6.0 + netcoreapp3.1;net6.0;net7.0 diff --git a/tests/Kubectl.Tests/Kubectl.Tests.csproj b/tests/Kubectl.Tests/Kubectl.Tests.csproj index 71523eb..c703750 100644 --- a/tests/Kubectl.Tests/Kubectl.Tests.csproj +++ b/tests/Kubectl.Tests/Kubectl.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net6.0;net7.0 enable enable false diff --git a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj index 5f9cd51..adf654d 100644 --- a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj +++ b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj @@ -1,4 +1,4 @@ - + false k8s.Tests @@ -14,7 +14,6 @@ - diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index b2d8543..18802a9 100644 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -2,7 +2,7 @@ false k8s.Tests - netcoreapp3.1;net5.0;net6.0 + netcoreapp3.1;net6.0;net7.0 diff --git a/version.json b/version.json index 320197d..f0c2436 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "9.0", + "version": "9.1", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/tags/v\\d+\\.\\d+\\.\\d+"