@@ -280,8 +280,6 @@ fn admission_error(error: tonic::Status) -> KubernetesDriverError {
280280 }
281281}
282282const SANDBOX_RUNTIME_RECONCILE_INTERVAL : Duration = Duration :: from_secs ( 30 ) ;
283- /// Bound how long a crash-interrupted, fail-closed bootstrap may remain stranded.
284- const SANDBOX_RUNTIME_BOOTSTRAP_GRACE : Duration = Duration :: from_mins ( 5 ) ;
285283
286284fn random_sandbox_runtime_token ( ) -> String {
287285 use std:: fmt:: Write as _;
@@ -2493,6 +2491,7 @@ impl KubernetesComputeDriver {
24932491 ) ,
24942492 dependent_owner. clone ( ) ,
24952493 & self . supervisor_tracing_environment ( ) ,
2494+ self . config . sandbox_attach_request_timeout_ms ,
24962495 )
24972496 . map_err ( KubernetesDriverError :: Message ) ?,
24982497 )
@@ -2727,6 +2726,7 @@ impl KubernetesComputeDriver {
27272726 names. supervisor_pod . clone ( ) ,
27282727 cr_name. to_string ( ) ,
27292728 Some ( cr_uid. to_string ( ) ) ,
2729+ Duration :: from_millis ( self . config . runtime_bootstrap_grace_ms ) ,
27302730 ) ;
27312731 // Return while the CR remains explicitly bootstrapping. The gateway
27322732 // can now commit the sandbox configuration required by a policy-less
@@ -2984,6 +2984,7 @@ impl KubernetesComputeDriver {
29842984 names. supervisor_pod . clone ( ) ,
29852985 cr_name. to_string ( ) ,
29862986 Some ( cr_uid. to_string ( ) ) ,
2987+ Duration :: from_millis ( self . config . runtime_bootstrap_grace_ms ) ,
29872988 ) ;
29882989 Ok ( ( ) )
29892990 }
@@ -3315,6 +3316,7 @@ impl KubernetesComputeDriver {
33153316 false ,
33163317 ) ,
33173318 & self . supervisor_tracing_environment ( ) ,
3319+ self . config . sandbox_attach_request_timeout_ms ,
33183320 )
33193321 . map_err ( KubernetesDriverError :: Message ) ?,
33203322 )
@@ -4211,7 +4213,7 @@ impl KubernetesComputeDriver {
42114213 if !sandbox_runtime_bootstrap_is_stale (
42124214 object,
42134215 SystemTime :: now ( ) ,
4214- SANDBOX_RUNTIME_BOOTSTRAP_GRACE ,
4216+ Duration :: from_millis ( self . config . runtime_bootstrap_grace_ms ) ,
42154217 ) {
42164218 return ;
42174219 }
@@ -4538,9 +4540,10 @@ fn spawn_sandbox_runtime_bootstrap_completion(
45384540 supervisor_pod_name : String ,
45394541 sandbox_name : String ,
45404542 expected_sandbox_uid : Option < String > ,
4543+ bootstrap_grace : Duration ,
45414544) {
45424545 tokio:: spawn ( async move {
4543- let deadline = tokio:: time:: Instant :: now ( ) + SANDBOX_RUNTIME_BOOTSTRAP_GRACE ;
4546+ let deadline = tokio:: time:: Instant :: now ( ) + bootstrap_grace ;
45444547 let available = |pod : Option < & Pod > | {
45454548 pod. is_some_and ( |pod| {
45464549 sandbox_runtime_control_availability_from_pod ( pod)
@@ -8562,6 +8565,7 @@ mod tests {
85628565 #[ test]
85638566 fn sandbox_runtime_bootstrap_marker_and_age_gate_rollback ( ) {
85648567 let started = Duration :: from_hours ( 490_896 ) ;
8568+ let bootstrap_grace = Duration :: from_mins ( 5 ) ;
85658569 let mut object: DynamicObject = serde_json:: from_value ( serde_json:: json!( {
85668570 "apiVersion" : "agents.x-k8s.io/v1beta1" ,
85678571 "kind" : "Sandbox" ,
@@ -8584,13 +8588,13 @@ mod tests {
85848588 let started_at = SystemTime :: UNIX_EPOCH + started;
85858589 assert ! ( !sandbox_runtime_bootstrap_is_stale(
85868590 & object,
8587- started_at + SANDBOX_RUNTIME_BOOTSTRAP_GRACE - Duration :: from_secs( 1 ) ,
8588- SANDBOX_RUNTIME_BOOTSTRAP_GRACE
8591+ started_at + bootstrap_grace - Duration :: from_secs( 1 ) ,
8592+ bootstrap_grace
85898593 ) ) ;
85908594 assert ! ( sandbox_runtime_bootstrap_is_stale(
85918595 & object,
8592- started_at + SANDBOX_RUNTIME_BOOTSTRAP_GRACE ,
8593- SANDBOX_RUNTIME_BOOTSTRAP_GRACE
8596+ started_at + bootstrap_grace ,
8597+ bootstrap_grace
85948598 ) ) ;
85958599 object
85968600 . metadata
@@ -8601,7 +8605,7 @@ mod tests {
86018605 assert ! ( sandbox_runtime_bootstrap_is_stale(
86028606 & object,
86038607 started_at,
8604- SANDBOX_RUNTIME_BOOTSTRAP_GRACE
8608+ bootstrap_grace
86058609 ) ) ;
86068610 object
86078611 . metadata
0 commit comments