File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ impl EpsilonInstance {
51
51
name : self . metadata . name . as_ref ( ) . unwrap ( ) . clone ( ) ,
52
52
template : self . spec . template . clone ( ) ,
53
53
state : self . get_state ( ) . clone ( ) ,
54
- slots : self . get_slots ( ) ,
54
+ slots : self . status . as_ref ( ) . unwrap ( ) . slots ,
55
55
online_count : self . get_online_count ( ) . await . unwrap_or ( 0 ) ,
56
56
}
57
57
}
@@ -63,13 +63,6 @@ impl EpsilonInstance {
63
63
}
64
64
}
65
65
66
- pub fn get_slots ( & self ) -> i32 {
67
- match & self . status {
68
- None => 0 ,
69
- Some ( status) => status. slots ,
70
- }
71
- }
72
-
73
66
pub async fn get_info ( & self ) -> EResult < StatusResponse > {
74
67
let status = self . status . as_ref ( ) . unwrap ( ) ;
75
68
let address = status. ip . as_ref ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use anyhow::format_err;
10
10
use futures:: StreamExt ;
11
11
use k8s_openapi:: apimachinery:: pkg:: apis:: meta:: v1:: ObjectMeta ;
12
12
use kube:: api:: { DeleteParams , ListParams , PostParams } ;
13
+ use kube:: runtime:: wait:: await_condition;
13
14
use kube:: Api ;
14
15
use serde_json:: json;
15
16
use std:: env;
@@ -66,6 +67,16 @@ impl InstanceProvider {
66
67
) -> EResult < Vec < Arc < EpsilonInstance > > > {
67
68
let mut instances = self . epsilon_controller . get_epsilon_instance_store ( ) . state ( ) ;
68
69
70
+ for instance in & instances {
71
+ let condition = await_condition (
72
+ self . epsilon_controller . get_epsilon_instance_api ( ) . clone ( ) ,
73
+ instance. metadata . name . as_ref ( ) . unwrap ( ) ,
74
+ move |instance : Option < & EpsilonInstance > | instance. is_some ( ) ,
75
+ ) ;
76
+
77
+ let _ = tokio:: time:: timeout ( std:: time:: Duration :: from_secs ( 3 ) , condition) . await ?;
78
+ }
79
+
69
80
instances = instances
70
81
. into_iter ( )
71
82
. filter ( |instance| {
You can’t perform that action at this time.
0 commit comments