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 ;
32using k8s . ClientSets ;
43using System . Threading . Tasks ;
54
Original file line number Diff line number Diff line change 2222void WatchUsingCallback ( IKubernetes client )
2323#pragma warning restore CS8321 // Remove unused private members
2424{
25- using var podlistResp = client . CoreV1 . WatchListNamespacedPod ( "default" ) ;
26- podlistResp . OnEvent += ( type , item ) =>
25+ using var podlistResp = client . CoreV1 . WatchListNamespacedPod ( "default" , onEvent : ( type , item ) =>
2726 {
2827 Console . WriteLine ( "==on watch event==" ) ;
2928 Console . WriteLine ( type ) ;
3029 Console . WriteLine ( item . Metadata . Name ) ;
3130 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+ } ) ;
4332 {
4433 Console . WriteLine ( "press ctrl + c to stop watching" ) ;
4534
You can’t perform that action at this time.
0 commit comments