Skip to content

Commit

Permalink
Merge pull request #158 from tintoy/feature/watch-retry
Browse files Browse the repository at this point in the history
Implement automatic retry of watch streams that terminate without any error
  • Loading branch information
tintoy authored Jul 13, 2024
2 parents ca2d8ed + 8cda77d commit ca10baa
Show file tree
Hide file tree
Showing 12 changed files with 210 additions and 45 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status (Travis CI)](https://travis-ci.org/tintoy/dotnet-kube-client.svg?branch=develop)](https://travis-ci.org/tintoy/dotnet-kube-client)

KubeClient is an extensible Kubernetes API client for .NET Core (targets `netstandard1.4`).
KubeClient is an extensible Kubernetes API client for .NET Core (targets `netstandard2.0`).

Note - there is also an [official](https://github.com/kubernetes-client/csharp/) .NET client for Kubernetes (both clients actually share code in a couple of places). These two clients are philosophically-different (from a design perspective) but either can be bent to fit your needs. For more information about how KubeClient differs from the official client, see the section below on [extensibility](#extensibility).

Expand All @@ -12,7 +12,7 @@ Note - there is also an [official](https://github.com/kubernetes-client/csharp/)

## Packages

* `KubeClient` (`netstandard1.4` or newer)
* `KubeClient` (`netstandard2.0` or newer)
The main client and models.
[![KubeClient](https://img.shields.io/nuget/v/KubeClient.svg)](https://www.nuget.org/packages/KubeClient)
* `KubeClient.Extensions.Configuration` (`netstandard2.0` or newer)
Expand All @@ -21,7 +21,7 @@ Note - there is also an [official](https://github.com/kubernetes-client/csharp/)
* `KubeClient.Extensions.DependencyInjection` (`netstandard2.0` or newer)
Dependency-injection support.
[![KubeClient.Extensions.KubeConfig](https://img.shields.io/nuget/v/KubeClient.Extensions.DependencyInjection.svg)](https://www.nuget.org/packages/KubeClient.Extensions.DependencyInjection)
* `KubeClient.Extensions.KubeConfig` (`netstandard1.4` or newer)
* `KubeClient.Extensions.KubeConfig` (`netstandard2.0` or newer)
Support for loading and parsing configuration from `~/.kube/config`.
[![KubeClient.Extensions.KubeConfig](https://img.shields.io/nuget/v/KubeClient.Extensions.KubeConfig.svg)](https://www.nuget.org/packages/KubeClient.Extensions.KubeConfig)
* `KubeClient.Extensions.WebSockets` (`netstandard2.1` or newer)
Expand Down
2 changes: 1 addition & 1 deletion samples/WatchEvents/WatchEvents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageReference Include="Serilog" Version="2.5.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Reactive" Version="4.4.1" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="4.9.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Reactive" Version="4.4.1" />
</ItemGroup>

<Import Project="..\Common.props" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>

<Description>Kubernetes client configuration support for KubeClient</Description>
</PropertyGroup>
Expand All @@ -14,7 +14,7 @@
<PackageReference Include="HTTPlease.Core" Version="$(PackageVersion_HTTPlease)" />
<PackageReference Include="BouncyCastle.NetCore" Version="1.8.1.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Reactive" Version="4.4.1" />
<PackageReference Include="YamlDotNet" Version="6.1.2" />
</ItemGroup>

Expand Down
12 changes: 9 additions & 3 deletions src/KubeClient/KubeApiException.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
using HTTPlease;
using System;

#if NETSTANDARD2_0

using System.Runtime.Serialization;

#endif // NETSTANDARD2_0

namespace KubeClient
{
using Models;

/// <summary>
/// Exception raised when an error result is returned by the Kubernetes API.
/// </summary>
#if NETSTANDARD20
#if NETSTANDARD2_0
[Serializable]
#endif // NETSTANDARD20
#endif // NETSTANDARD2_0
public class KubeApiException
: KubeClientException
{
Expand Down Expand Up @@ -106,7 +112,7 @@ public KubeApiException(HttpRequestException<StatusV1> requestException)
/// <param name="context">
/// A <see cref="StreamingContext"/> containing information about the origin of the serialised data.
/// </param>
protected KubeClientException(SerializationInfo info, StreamingContext context)
protected KubeApiException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/KubeClient/KubeClient.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>

<Description>A Kubernetes API client for .NET</Description>
</PropertyGroup>
Expand All @@ -12,7 +12,7 @@
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="1.1.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="System.Reactive" Version="4.4.1" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="YamlDotNet" Version="6.1.2" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/KubeClient/KubeClientException.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
using HTTPlease;
using System;

#if NETSTANDARD2_0

using System.Runtime.Serialization;

#endif // NETSTANDARD2_0

namespace KubeClient
{
using Models;
Expand Down
Loading

0 comments on commit ca10baa

Please sign in to comment.