Fix log return disposed obj (#705)
* generator not to dispose stream * new generated code * test to cover log stream
This commit is contained in:
@@ -466,7 +466,7 @@ namespace k8s
|
||||
}
|
||||
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
|
||||
}
|
||||
{{/IfReturnType operation "stream"}}
|
||||
{{/IfReturnType operation "obj"}}
|
||||
}
|
||||
{{/IfReturnType operation "any"}}
|
||||
if (_shouldTrace)
|
||||
|
||||
@@ -64,6 +64,17 @@ namespace k8s
|
||||
{{/operation.parameters}}
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
{{#IfReturnType operation "stream"}}
|
||||
var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetName .}},
|
||||
{{/operation.parameters}}
|
||||
null,
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
{{GetReturnType operation "_result.Body"}};
|
||||
{{/IfReturnType operation "stream"}}
|
||||
{{#IfReturnType operation "obj"}}
|
||||
using (var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetName .}},
|
||||
@@ -73,6 +84,17 @@ namespace k8s
|
||||
{
|
||||
{{GetReturnType operation "_result.Body"}};
|
||||
}
|
||||
{{/IfReturnType operation "obj"}}
|
||||
{{#IfReturnType operation "void"}}
|
||||
using (var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetName .}},
|
||||
{{/operation.parameters}}
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
}
|
||||
{{/IfReturnType operation "void"}}
|
||||
}
|
||||
|
||||
{{/.}}
|
||||
|
||||
@@ -956,7 +956,7 @@ namespace KubernetesWatchGenerator
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
else if (type == "stream" && rt == "Stream")
|
||||
else if (type.ToLower() == rt.ToLower())
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
|
||||
389
src/KubernetesClient/generated/KubernetesExtensions.cs
generated
389
src/KubernetesClient/generated/KubernetesExtensions.cs
generated
@@ -12671,7 +12671,7 @@ namespace k8s
|
||||
bool? tty = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedPodAttachWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedPodAttachWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
container,
|
||||
@@ -12680,10 +12680,9 @@ namespace k8s
|
||||
stdout,
|
||||
tty,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -12789,7 +12788,7 @@ namespace k8s
|
||||
bool? tty = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedPodAttachWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedPodAttachWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
container,
|
||||
@@ -12798,10 +12797,9 @@ namespace k8s
|
||||
stdout,
|
||||
tty,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13418,7 +13416,7 @@ namespace k8s
|
||||
bool? tty = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedPodExecWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedPodExecWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
command,
|
||||
@@ -13428,10 +13426,9 @@ namespace k8s
|
||||
stdout,
|
||||
tty,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13540,7 +13537,7 @@ namespace k8s
|
||||
bool? tty = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedPodExecWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedPodExecWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
command,
|
||||
@@ -13550,10 +13547,9 @@ namespace k8s
|
||||
stdout,
|
||||
tty,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13713,7 +13709,7 @@ namespace k8s
|
||||
bool? timestamps = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ReadNamespacedPodLogWithHttpMessagesAsync(
|
||||
var _result = await operations.ReadNamespacedPodLogWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
container,
|
||||
@@ -13726,10 +13722,9 @@ namespace k8s
|
||||
tailLines,
|
||||
timestamps,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13787,15 +13782,14 @@ namespace k8s
|
||||
int? ports = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedPodPortforwardWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedPodPortforwardWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
ports,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13853,15 +13847,14 @@ namespace k8s
|
||||
int? ports = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedPodPortforwardWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedPodPortforwardWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
ports,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13919,15 +13912,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -13985,15 +13977,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14051,15 +14042,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14117,15 +14107,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14183,15 +14172,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14249,15 +14237,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNamespacedPodProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNamespacedPodProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14324,16 +14311,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14400,16 +14386,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14476,16 +14461,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14552,16 +14536,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14628,16 +14611,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -14704,16 +14686,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNamespacedPodProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22341,15 +22322,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22415,15 +22395,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22489,15 +22468,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22563,15 +22541,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22637,15 +22614,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22711,15 +22687,14 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNamespacedServiceProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22794,16 +22769,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22878,16 +22852,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22962,16 +22935,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -23046,16 +23018,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -23130,16 +23101,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -23214,16 +23184,15 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNamespacedServiceProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
namespaceParameter,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25358,14 +25327,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25414,14 +25382,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25470,14 +25437,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25526,14 +25492,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25582,14 +25547,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25638,14 +25602,13 @@ namespace k8s
|
||||
string path = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNodeProxyWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNodeProxyWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25703,15 +25666,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectDeleteNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectDeleteNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25769,15 +25731,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectGetNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectGetNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25835,15 +25796,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectHeadNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectHeadNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25901,15 +25861,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPatchNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPatchNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -25967,15 +25926,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPostNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPostNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -26033,15 +25991,14 @@ namespace k8s
|
||||
string path1 = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.ConnectPutNodeProxyWithPathWithHttpMessagesAsync(
|
||||
var _result = await operations.ConnectPutNodeProxyWithPathWithHttpMessagesAsync(
|
||||
name,
|
||||
path,
|
||||
path1,
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
return _result.Body;
|
||||
}
|
||||
cancellationToken);
|
||||
_result.Request.Dispose();
|
||||
return _result.Body;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -94394,7 +94351,6 @@ namespace k8s
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94440,7 +94396,6 @@ namespace k8s
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -28,9 +29,19 @@ namespace k8s.E2E
|
||||
void Cleanup()
|
||||
{
|
||||
var pods = client.ListNamespacedPod(namespaceParameter);
|
||||
if (pods.Items.Any(p => p.Metadata.Name == podName))
|
||||
while (pods.Items.Any(p => p.Metadata.Name == podName))
|
||||
{
|
||||
client.DeleteNamespacedPod(podName, namespaceParameter);
|
||||
try
|
||||
{
|
||||
client.DeleteNamespacedPod(podName, namespaceParameter);
|
||||
}
|
||||
catch (HttpOperationException e)
|
||||
{
|
||||
if (e.Response.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,6 +337,105 @@ namespace k8s.E2E
|
||||
}
|
||||
}
|
||||
|
||||
[MinikubeFact]
|
||||
public async Task LogStreamTestAsync()
|
||||
{
|
||||
var namespaceParameter = "default";
|
||||
var podName = "k8scsharp-e2e-logstream-pod";
|
||||
|
||||
var client = CreateClient();
|
||||
|
||||
void Cleanup()
|
||||
{
|
||||
var pods = client.ListNamespacedPod(namespaceParameter);
|
||||
while (pods.Items.Any(p => p.Metadata.Name == podName))
|
||||
{
|
||||
try
|
||||
{
|
||||
client.DeleteNamespacedPod(podName, namespaceParameter);
|
||||
}
|
||||
catch (HttpOperationException e)
|
||||
{
|
||||
if (e.Response.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Cleanup();
|
||||
|
||||
client.CreateNamespacedPod(
|
||||
new V1Pod()
|
||||
{
|
||||
Metadata = new V1ObjectMeta { Name = podName, },
|
||||
Spec = new V1PodSpec
|
||||
{
|
||||
Containers = new[]
|
||||
{
|
||||
new V1Container()
|
||||
{
|
||||
Name = "k8scsharp-e2e-logstream",
|
||||
Image = "busybox",
|
||||
Command = new[] { "ping" },
|
||||
Args = new[] { "-i", "10", "127.0.0.1" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
namespaceParameter);
|
||||
|
||||
var lines = new List<string>();
|
||||
var started = new ManualResetEvent(false);
|
||||
|
||||
async Task<V1Pod> Pod()
|
||||
{
|
||||
var pods = client.ListNamespacedPod(namespaceParameter);
|
||||
var pod = pods.Items.First();
|
||||
while (pod.Status.Phase != "Running")
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
|
||||
return await Pod().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return pod;
|
||||
}
|
||||
|
||||
var pod = await Pod().ConfigureAwait(false);
|
||||
var stream = client.ReadNamespacedPodLog(pod.Metadata.Name, pod.Metadata.NamespaceProperty, follow: true);
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
var copytask = Task.Run(() =>
|
||||
{
|
||||
for (; ; )
|
||||
{
|
||||
try
|
||||
{
|
||||
lines.Add(reader.ReadLine());
|
||||
}
|
||||
finally
|
||||
{
|
||||
started.Set();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Assert.True(started.WaitOne(TimeSpan.FromMinutes(2)));
|
||||
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
|
||||
Assert.Null(copytask.Exception);
|
||||
Assert.Equal(2, lines.Count);
|
||||
await Task.Delay(TimeSpan.FromSeconds(11)).ConfigureAwait(false);
|
||||
Assert.Equal(3, lines.Count);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
[MinikubeFact]
|
||||
public async Task DatetimeFieldTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user