Xin Yan 5adf9a3841 bug fix - remove port bytes during port forwarding (#233)
* fix a race condition.
when multiple call to GetStream happens around the same time, on the
same inputIndex, a race condition will cause this.buffers.Add() to throw
exception.

* add WebSocket server certificate validation support for net 452

* port forwarding bug fix

In StreamDemuxer, if the buffer is created before connection is established, the port bytes are not removed when
the bytes are delivering to the client. Repro code looks like (the key is to call remoteStreams.Start AFTER
GetStream):

  var ws = await kubernetesClient.WebSocketNamespacedPodPortForwardAsync (... )
  var remoteStreams = new StreamDemuxer(ws);
  var stream = remoteStreams.GetStream(0, 0);
  remoteStreams.Start();

This change filters out the port bytes which are the 2nd and 3rd bytes sent in all cases.

* incorporate review feedbacks.
add an enum StreamType to StreamDemuxer so it knows whether / how
the data stream should be handled.

* add tests, fix skip bytes scenario for multiple streams

* add more tests for verifying content.

* simplify code a bit
2019-02-01 14:57:09 -08:00
2017-10-24 17:05:26 +08:00
2018-05-31 22:57:10 -07:00
2018-05-07 11:53:15 -07:00
2018-08-19 15:46:42 -07:00
2018-12-11 21:10:39 -08:00
2018-10-26 23:04:22 -07:00
2018-07-09 06:50:39 -07:00
2017-05-12 10:18:12 -07:00
2017-05-12 10:20:28 -07:00
2018-08-19 15:46:42 -07:00
2018-06-25 07:14:27 -07:00
2018-12-11 21:10:39 -08:00

Kubernetes C# Client

Travis Client Capabilities Client Support Level

Usage

Nuget Package

dotnet add package KubernetesClient

Generating the Client Code

Prerequisites

You'll need a Linux machine with Docker.

The generated code works on all platforms supported by .NET or .NET Core.

Check out the generator project into some other directory (henceforth $GEN_DIR)

cd $GEN_DIR/..
git clone https://github.com/kubernetes-client/gen

Generating code

# Where REPO_DIR points to the root of the csharp repository
cd ${REPO_DIR}/csharp/src
${GEN_DIR}/openapi/csharp.sh generated ../csharp.settings

Usage

Running the Examples

git clone git@github.com:kubernetes-client/csharp.git
cd csharp\examples\simple
dotnet run

Known issues

While preferred way of connecting to a remote cluster from local machine is:

var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(config);

Not all auth providers are supported at moment #91, but you still can connect to cluster by starting proxy:

$ kubectl proxy
Starting to serve on 127.0.0.1:8001

and changing config:

var config = new KubernetesClientConfiguration {  Host = "http://127.0.0.1:8001" };

Notice that this is a workaround and is not recommended for production use

Testing

The project uses XUnit as unit testing framework.

To run the tests

cd csharp\tests
dotnet restore
dotnet test

Contributing

Please see CONTRIBUTING.md for instructions on how to contribute.

Description
No description provided
Readme Apache-2.0 11 MiB
Languages
C# 100%