File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 1
- // See https://aka.ms/new-console-template for more information
2
- using k8s ;
1
+ using k8s ;
3
2
using k8s . ClientSets ;
4
3
using System . Threading . Tasks ;
5
4
Original file line number Diff line number Diff line change 22
22
void WatchUsingCallback ( IKubernetes client )
23
23
#pragma warning restore CS8321 // Remove unused private members
24
24
{
25
- using var podlistResp = client . CoreV1 . WatchListNamespacedPod ( "default" ) ;
26
- podlistResp . OnEvent += ( type , item ) =>
25
+ using var podlistResp = client . CoreV1 . WatchListNamespacedPod ( "default" , onEvent : ( type , item ) =>
27
26
{
28
27
Console . WriteLine ( "==on watch event==" ) ;
29
28
Console . WriteLine ( type ) ;
30
29
Console . WriteLine ( item . Metadata . Name ) ;
31
30
Console . WriteLine ( "==on watch event==" ) ;
32
- } ;
33
- podlistResp . OnError += ( error ) =>
34
- {
35
- Console . WriteLine ( "==on watch error==" ) ;
36
- Console . WriteLine ( error . Message ) ;
37
- Console . WriteLine ( "==on watch error==" ) ;
38
- } ;
39
- podlistResp . OnClosed += ( ) =>
40
- {
41
- Console . WriteLine ( "==on watch closed==" ) ;
42
- } ;
31
+ } ) ;
43
32
{
44
33
Console . WriteLine ( "press ctrl + c to stop watching" ) ;
45
34
You can’t perform that action at this time.
0 commit comments