@@ -12,6 +12,7 @@ namespace k8s
12
12
using Newtonsoft.Json;
13
13
using System.Collections;
14
14
using System.Collections.Generic;
15
+ using System.IO;
15
16
using System.Net;
16
17
using System.Net.Http;
17
18
using System.Threading;
@@ -240,6 +241,7 @@ public Kubernetes(System.Uri baseUri, ServiceClientCredentials credentials, Http
240
241
/// </summary>
241
242
private void Initialize()
242
243
{
244
+ BaseUri = new System.Uri("http://localhost");
243
245
SerializationSettings = new JsonSerializerSettings
244
246
{
245
247
Formatting = Newtonsoft.Json.Formatting.Indented,
@@ -12794,7 +12796,7 @@ private void Initialize()
12794
12796
/// <return>
12795
12797
/// A response object containing the response body and response headers.
12796
12798
/// </return>
12797
- public async Task<HttpOperationResponse<string >> ReadNamespacedPodLogWithHttpMessagesAsync(string name, string namespaceParameter, string container = default(string), bool? follow = default(bool?), int? limitBytes = default(int?), string pretty = default(string), bool? previous = default(bool?), int? sinceSeconds = default(int?), int? tailLines = default(int?), bool? timestamps = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
12799
+ public async Task<HttpOperationResponse<Stream >> ReadNamespacedPodLogWithHttpMessagesAsync(string name, string namespaceParameter, string container = default(string), bool? follow = default(bool?), int? limitBytes = default(int?), string pretty = default(string), bool? previous = default(bool?), int? sinceSeconds = default(int?), int? tailLines = default(int?), bool? timestamps = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
12798
12800
{
12799
12801
if (name == null)
12800
12802
{
@@ -12900,7 +12902,7 @@ private void Initialize()
12900
12902
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
12901
12903
}
12902
12904
cancellationToken.ThrowIfCancellationRequested();
12903
- _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
12905
+ _httpResponse = await HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
12904
12906
if (_shouldTrace)
12905
12907
{
12906
12908
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
@@ -12931,26 +12933,13 @@ private void Initialize()
12931
12933
throw ex;
12932
12934
}
12933
12935
// Create Result
12934
- var _result = new HttpOperationResponse<string >();
12936
+ var _result = new HttpOperationResponse<Stream >();
12935
12937
_result.Request = _httpRequest;
12936
12938
_result.Response = _httpResponse;
12937
12939
// Deserialize Response
12938
12940
if ((int)_statusCode == 200)
12939
12941
{
12940
- _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
12941
- try
12942
- {
12943
- _result.Body = SafeJsonConvert.DeserializeObject<string>(_responseContent, DeserializationSettings);
12944
- }
12945
- catch (JsonException ex)
12946
- {
12947
- _httpRequest.Dispose();
12948
- if (_httpResponse != null)
12949
- {
12950
- _httpResponse.Dispose();
12951
- }
12952
- throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
12953
- }
12942
+ _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
12954
12943
}
12955
12944
if (_shouldTrace)
12956
12945
{
0 commit comments