@@ -44,7 +44,7 @@ use kube::{
4444use std:: { collections:: BTreeMap , sync:: Arc } ;
4545
4646use std:: time:: Duration ;
47- use tracing:: { debug, error, info, instrument, warn} ;
47+ use tracing:: { debug, error, info, instrument, trace , warn} ;
4848
4949use crate :: {
5050 cloud:: Provisioner ,
@@ -479,22 +479,20 @@ fn error_policy_exit_node(
479479 Action :: requeue ( Duration :: from_secs ( 5 ) )
480480}
481481const UNMANAGED_PROVISIONER : & str = "unmanaged" ;
482+
482483#[ instrument( skip( ctx) ) ]
483484async fn reconcile_nodes ( obj : Arc < ExitNode > , ctx : Arc < Context > ) -> Result < Action , ReconcileError > {
484485 info ! ( "exit node reconcile request: {}" , obj. name_any( ) ) ;
485-
486486 let is_managed = check_exit_node_managed ( & obj) . await ;
487-
488487 debug ! ( ?is_managed, "exit node is managed by cloud provisioner?" ) ;
489-
490488 let exit_nodes: Api < ExitNode > = Api :: namespaced ( ctx. client . clone ( ) , & obj. namespace ( ) . unwrap ( ) ) ;
491489
492490 // finalizer for exit node
493-
494491 let serverside = PatchParams :: apply ( OPERATOR_MANAGER ) . validation_strict ( ) ;
495492
496493 if !is_managed && obj. status . is_none ( ) {
497494 // add status to exit node if it's not managed
495+ // This is the case for self-hosted exit nodes (Manually )
498496
499497 let nodes: Api < ExitNode > = Api :: namespaced ( ctx. client . clone ( ) , & obj. namespace ( ) . unwrap ( ) ) ;
500498
@@ -525,12 +523,14 @@ async fn reconcile_nodes(obj: Arc<ExitNode>, ctx: Arc<Context>) -> Result<Action
525523
526524 return Ok ( Action :: await_change ( ) ) ;
527525 } else if is_managed {
526+ // XXX: What the fuck.
528527 let provisioner = obj
529528 . metadata
530529 . annotations
531530 . as_ref ( )
532531 . and_then ( |annotations| annotations. get ( EXIT_NODE_PROVISIONER_LABEL ) )
533532 . unwrap ( ) ;
533+ trace ! ( ?provisioner, "Provisioner" ) ;
534534 if let Some ( status) = & obj. status {
535535 // Check for mismatch between annotation's provisioner and status' provisioner
536536 if & status. provider != provisioner {
0 commit comments