@@ -23,13 +23,13 @@ public partial class Kubernetes
23
23
public Func < WebSocketBuilder > CreateWebSocketBuilder { get ; set ; } = ( ) => new WebSocketBuilder ( ) ;
24
24
25
25
/// <inheritdoc/>
26
- public Task < WebSocket > WebSocketNamespacedPodExecAsync ( string name , string @namespace = "default" , string command = null , string container = null , bool stderr = true , bool stdin = true , bool stdout = true , bool tty = true , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
26
+ public Task < WebSocket > WebSocketNamespacedPodExecAsync ( string name , string @namespace = "default" , string command = null , string container = null , bool stderr = true , bool stdin = true , bool stdout = true , bool tty = true , string webSocketSubProtol = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
27
27
{
28
- return WebSocketNamespacedPodExecAsync ( name , @namespace , new string [ ] { command } , container , stderr , stdin , stdout , tty , customHeaders , cancellationToken ) ;
28
+ return WebSocketNamespacedPodExecAsync ( name , @namespace , new string [ ] { command } , container , stderr , stdin , stdout , tty , webSocketSubProtol , customHeaders , cancellationToken ) ;
29
29
}
30
30
31
31
/// <inheritdoc/>
32
- public Task < WebSocket > WebSocketNamespacedPodExecAsync ( string name , string @namespace = "default" , IEnumerable < string > command = null , string container = null , bool stderr = true , bool stdin = true , bool stdout = true , bool tty = true , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
32
+ public Task < WebSocket > WebSocketNamespacedPodExecAsync ( string name , string @namespace = "default" , IEnumerable < string > command = null , string container = null , bool stderr = true , bool stdin = true , bool stdout = true , bool tty = true , string webSocketSubProtol = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
33
33
{
34
34
if ( name == null )
35
35
{
@@ -66,6 +66,7 @@ public partial class Kubernetes
66
66
tracingParameters . Add ( "stdin" , stdin ) ;
67
67
tracingParameters . Add ( "stdout" , stdout ) ;
68
68
tracingParameters . Add ( "tty" , tty ) ;
69
+ tracingParameters . Add ( "webSocketSubProtol" , webSocketSubProtol ) ;
69
70
tracingParameters . Add ( "cancellationToken" , cancellationToken ) ;
70
71
ServiceClientTracing . Enter ( _invocationId , this , nameof ( WebSocketNamespacedPodExecAsync ) , tracingParameters ) ;
71
72
}
@@ -103,11 +104,11 @@ public partial class Kubernetes
103
104
104
105
uriBuilder . Query = query ;
105
106
106
- return this . StreamConnectAsync ( uriBuilder . Uri , _invocationId , customHeaders , cancellationToken ) ;
107
+ return this . StreamConnectAsync ( uriBuilder . Uri , _invocationId , webSocketSubProtol , customHeaders , cancellationToken ) ;
107
108
}
108
109
109
110
/// <inheritdoc/>
110
- public Task < WebSocket > WebSocketNamespacedPodPortForwardAsync ( string name , string @namespace , IEnumerable < int > ports , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
111
+ public Task < WebSocket > WebSocketNamespacedPodPortForwardAsync ( string name , string @namespace , IEnumerable < int > ports , string webSocketSubProtocol = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
111
112
{
112
113
if ( name == null )
113
114
{
@@ -134,6 +135,7 @@ public partial class Kubernetes
134
135
tracingParameters . Add ( "name" , name ) ;
135
136
tracingParameters . Add ( "@namespace" , @namespace ) ;
136
137
tracingParameters . Add ( "ports" , ports ) ;
138
+ tracingParameters . Add ( "webSocketSubProtocol" , webSocketSubProtocol ) ;
137
139
tracingParameters . Add ( "cancellationToken" , cancellationToken ) ;
138
140
ServiceClientTracing . Enter ( _invocationId , this , nameof ( WebSocketNamespacedPodPortForwardAsync ) , tracingParameters ) ;
139
141
}
@@ -158,11 +160,11 @@ public partial class Kubernetes
158
160
159
161
160
162
161
- return StreamConnectAsync ( uriBuilder . Uri , _invocationId , customHeaders , cancellationToken ) ;
163
+ return StreamConnectAsync ( uriBuilder . Uri , _invocationId , webSocketSubProtocol , customHeaders , cancellationToken ) ;
162
164
}
163
165
164
166
/// <inheritdoc/>
165
- public Task < WebSocket > WebSocketNamespacedPodAttachAsync ( string name , string @namespace , string container = default ( string ) , bool stderr = true , bool stdin = false , bool stdout = true , bool tty = false , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
167
+ public Task < WebSocket > WebSocketNamespacedPodAttachAsync ( string name , string @namespace , string container = default ( string ) , bool stderr = true , bool stdin = false , bool stdout = true , bool tty = false , string webSocketSubProtol = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
166
168
{
167
169
if ( name == null )
168
170
{
@@ -188,6 +190,7 @@ public partial class Kubernetes
188
190
tracingParameters . Add ( "stdin" , stdin ) ;
189
191
tracingParameters . Add ( "stdout" , stdout ) ;
190
192
tracingParameters . Add ( "tty" , tty ) ;
193
+ tracingParameters . Add ( "webSocketSubProtol" , webSocketSubProtol ) ;
191
194
tracingParameters . Add ( "cancellationToken" , cancellationToken ) ;
192
195
ServiceClientTracing . Enter ( _invocationId , this , nameof ( WebSocketNamespacedPodAttachAsync ) , tracingParameters ) ;
193
196
}
@@ -212,10 +215,10 @@ public partial class Kubernetes
212
215
{ "tty" , tty ? "1" : "0" }
213
216
} ) . TrimStart ( '?' ) ;
214
217
215
- return StreamConnectAsync ( uriBuilder . Uri , _invocationId , customHeaders , cancellationToken ) ;
218
+ return StreamConnectAsync ( uriBuilder . Uri , _invocationId , webSocketSubProtol , customHeaders , cancellationToken ) ;
216
219
}
217
220
218
- protected async Task < WebSocket > StreamConnectAsync ( Uri uri , string invocationId = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
221
+ protected async Task < WebSocket > StreamConnectAsync ( Uri uri , string invocationId = null , string webSocketSubProtocol = null , Dictionary < string , List < string > > customHeaders = null , CancellationToken cancellationToken = default ( CancellationToken ) )
219
222
{
220
223
bool _shouldTrace = ServiceClientTracing . IsEnabled ;
221
224
@@ -258,11 +261,16 @@ public partial class Kubernetes
258
261
{
259
262
webSocketBuilder . ExpectServerCertificate ( this . CaCert ) ;
260
263
}
264
+
261
265
if ( this . SkipTlsVerify )
262
266
{
263
267
webSocketBuilder . SkipServerCertificateValidation ( ) ;
264
268
}
265
- webSocketBuilder . Options . RequestedSubProtocols . Add ( K8sProtocol . ChannelV1 ) ;
269
+
270
+ if ( webSocketSubProtocol != null )
271
+ {
272
+ webSocketBuilder . Options . RequestedSubProtocols . Add ( webSocketSubProtocol ) ;
273
+ }
266
274
#endif // NETCOREAPP2_1
267
275
268
276
// Send Request
0 commit comments