File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ pub fn generate_chisel_flags(node: &ExitNode) -> Vec<String> {
178178/// Returns:
179179///
180180/// a `PodTemplateSpec` object.
181- #[ instrument]
181+ #[ instrument( skip ( source , exit_node ) ) ]
182182pub async fn create_pod_template (
183183 source : & Service ,
184184 exit_node : & ExitNode ,
@@ -254,7 +254,7 @@ pub async fn create_pod_template(
254254/// Returns:
255255///
256256/// a `Deployment` object.
257- #[ instrument]
257+ #[ instrument( skip ( source , exit_node ) ) ]
258258pub async fn create_owned_deployment (
259259 source : & Service ,
260260 exit_node : & ExitNode ,
Original file line number Diff line number Diff line change @@ -97,5 +97,15 @@ async fn main() -> Result<()> {
9797 ) ;
9898 info ! ( "Starting up..." ) ;
9999
100+ // Set up a handler for graceful pod termination
101+ tokio:: spawn ( async move {
102+ tokio:: signal:: unix:: signal ( tokio:: signal:: unix:: SignalKind :: terminate ( ) )
103+ . unwrap ( )
104+ . recv ( )
105+ . await ;
106+ info ! ( "Received termination signal, shutting down..." ) ;
107+ std:: process:: exit ( 0 ) ;
108+ } ) ;
109+
100110 daemon:: run ( ) . await
101111}
You can’t perform that action at this time.
0 commit comments