diff --git a/ci.sh b/ci.sh index 5fe7fb2..911ad11 100755 --- a/ci.sh +++ b/ci.sh @@ -31,7 +31,7 @@ echo Generating Code Coverage reports export PATH="$PATH:$HOME/.dotnet/tools" export DOTNET_ROOT=$(dirname $(realpath $(which dotnet))) # https://github.com/dotnet/cli/issues/9114#issuecomment-401670622 dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.0.15 -reportgenerator "-reports:**/*.opencover.xml" "-targetdir:coveragereport" "-reporttypes:HTMLInline;Cobertura" +reportgenerator "-reports:**/*.opencover*.xml" "-targetdir:coveragereport" "-reporttypes:HTMLInline;Cobertura" ls coveragereport ls coveragereport/Cobertura.xml diff --git a/gen/KubernetesWatchGenerator/KubernetesWatchGenerator.csproj b/gen/KubernetesWatchGenerator/KubernetesWatchGenerator.csproj index 70d70f7..c020db5 100644 --- a/gen/KubernetesWatchGenerator/KubernetesWatchGenerator.csproj +++ b/gen/KubernetesWatchGenerator/KubernetesWatchGenerator.csproj @@ -1,4 +1,4 @@ - + Exe @@ -9,7 +9,7 @@ - + diff --git a/src/KubernetesClient/Kubernetes.ConfigInit.cs b/src/KubernetesClient/Kubernetes.ConfigInit.cs index 63bc79c..16cc033 100644 --- a/src/KubernetesClient/Kubernetes.ConfigInit.cs +++ b/src/KubernetesClient/Kubernetes.ConfigInit.cs @@ -56,11 +56,7 @@ namespace k8s /// Optional. The delegating handlers to add to the http client pipeline. /// public Kubernetes(KubernetesClientConfiguration config, params DelegatingHandler[] handlers) -#if MONOANDROID8_1 - : this(new Xamarin.Android.Net.AndroidClientHandler(), handlers) -#else : this(handlers) -#endif { ValidateConfig(config); CaCerts = config.SslCaCerts; @@ -162,7 +158,7 @@ namespace k8s partial void CustomInitialize() { -#if NET452 || XAMARINIOS1_0 || MONOANDROID8_1 +#if NET452 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; #endif AppendDelegatingHandler(); diff --git a/src/KubernetesClient/KubernetesClient.csproj b/src/KubernetesClient/KubernetesClient.csproj index b832cae..5b374c7 100644 --- a/src/KubernetesClient/KubernetesClient.csproj +++ b/src/KubernetesClient/KubernetesClient.csproj @@ -9,9 +9,8 @@ https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png kubernetes;docker;containers; - netstandard1.4;netstandard2.0;net452;net461;netcoreapp2.1;xamarinios10;monoandroid81 - netstandard1.4;netstandard2.0;net452;net461;netcoreapp2.1 - netstandard1.4;netstandard2.0;netcoreapp2.1 + netstandard2.0;net452;netcoreapp2.1 + netstandard2.0;netcoreapp2.1 k8s true kubernetes-client.snk @@ -34,30 +33,13 @@ - - + - - - - - - - - - - - - - - - - diff --git a/src/KubernetesClient/KubernetesClientConfiguration.HttpClientHandler.cs b/src/KubernetesClient/KubernetesClientConfiguration.HttpClientHandler.cs index c52f3e7..6689445 100644 --- a/src/KubernetesClient/KubernetesClientConfiguration.HttpClientHandler.cs +++ b/src/KubernetesClient/KubernetesClientConfiguration.HttpClientHandler.cs @@ -33,11 +33,6 @@ namespace k8s } public void AddCertificates(HttpClientHandler handler) { -#if XAMARINIOS1_0 || MONOANDROID8_1 - // handle.ClientCertificates is not implemented in Xamarin. - return; -#endif - if ((!string.IsNullOrWhiteSpace(this.ClientCertificateData) || !string.IsNullOrWhiteSpace(this.ClientCertificateFilePath)) && (!string.IsNullOrWhiteSpace(this.ClientCertificateKeyData) || diff --git a/src/KubernetesClient/KubernetesException.cs b/src/KubernetesClient/KubernetesException.cs index 72a9177..ee25cda 100644 --- a/src/KubernetesClient/KubernetesException.cs +++ b/src/KubernetesClient/KubernetesException.cs @@ -1,8 +1,6 @@ using k8s.Models; using System; -#if !NETSTANDARD1_4 using System.Runtime.Serialization; -#endif namespace k8s { @@ -58,7 +56,6 @@ namespace k8s { } -#if !NETSTANDARD1_4 /// /// Initializes a new instance of the class with serialized data. /// @@ -74,7 +71,6 @@ namespace k8s : base(info, context) { } -#endif /// /// Gets, when this exception was raised because of a Kubernetes status message, the underlying diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index ea02cc4..c9f5822 100755 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -6,10 +6,14 @@ - + + + true + + - - + + @@ -21,15 +25,15 @@ - + all runtime; build; native; contentfiles; analyzers - - + + diff --git a/tests/KubernetesClient.Tests/Mock/MockKubeApiServer.cs b/tests/KubernetesClient.Tests/Mock/MockKubeApiServer.cs index 5a22b06..4869c4c 100644 --- a/tests/KubernetesClient.Tests/Mock/MockKubeApiServer.cs +++ b/tests/KubernetesClient.Tests/Mock/MockKubeApiServer.cs @@ -14,7 +14,7 @@ using Xunit.Abstractions; namespace k8s.Tests.Mock { - public class MockKubeApiServer : IDisposable + public sealed class MockKubeApiServer : IDisposable { // paste from minikube /api/v1/namespaces/default/pods public const string MockPodResponse = diff --git a/tests/KubernetesClient.Tests/YamlTests.cs b/tests/KubernetesClient.Tests/YamlTests.cs index f2e366a..58d8b2a 100644 --- a/tests/KubernetesClient.Tests/YamlTests.cs +++ b/tests/KubernetesClient.Tests/YamlTests.cs @@ -28,11 +28,11 @@ metadata: types.Add("v1/Namespace", typeof(V1Namespace)); var objs = Yaml.LoadAllFromString(content, types); - Assert.Equal(objs.Count, 2); + Assert.Equal(2, objs.Count); Assert.IsType(objs[0]); Assert.IsType(objs[1]); - Assert.Equal(((V1Pod) objs[0]).Metadata.Name, "foo"); - Assert.Equal(((V1Namespace) objs[1]).Metadata.Name, "ns"); + Assert.Equal("foo", ((V1Pod) objs[0]).Metadata.Name); + Assert.Equal("ns", ((V1Namespace) objs[1]).Metadata.Name); } [Fact]