File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -225,7 +225,10 @@ impl Config {
225225
226226 Some ( Cluster {
227227 nodes : filtered_nodes,
228- defaults : ClusterDefaults :: default ( ) ,
228+ defaults : ClusterDefaults {
229+ ssh_key : Some ( "/home/config/ssh/id_cluster" . to_string ( ) ) ,
230+ ..ClusterDefaults :: default ( )
231+ } ,
229232 interactive : None ,
230233 } )
231234 }
Original file line number Diff line number Diff line change @@ -51,6 +51,13 @@ async fn test_backendai_env_auto_detection() {
5151 // Get the bai_auto cluster
5252 let cluster = config. clusters . get ( "bai_auto" ) . unwrap ( ) ;
5353
54+ // Verify SSH key is set to Backend.AI cluster key
55+ assert_eq ! (
56+ cluster. defaults. ssh_key,
57+ Some ( "/home/config/ssh/id_cluster" . to_string( ) ) ,
58+ "Backend.AI cluster should use /home/config/ssh/id_cluster as SSH key"
59+ ) ;
60+
5461 // Verify nodes were parsed correctly
5562 assert_eq ! ( cluster. nodes. len( ) , 3 ) ;
5663
@@ -66,6 +73,13 @@ async fn test_backendai_env_auto_detection() {
6673 assert_eq ! ( nodes[ 1 ] . host, "node2.ai" ) ;
6774 assert_eq ! ( nodes[ 2 ] . host, "node3.ai" ) ;
6875
76+ // Verify get_ssh_key returns the correct key for Backend.AI cluster
77+ assert_eq ! (
78+ config. get_ssh_key( Some ( "bai_auto" ) ) ,
79+ Some ( "/home/config/ssh/id_cluster" . to_string( ) ) ,
80+ "get_ssh_key should return Backend.AI cluster key path"
81+ ) ;
82+
6983 // Restore original env vars
7084 unsafe {
7185 if let Some ( val) = orig_hosts {
You can’t perform that action at this time.
0 commit comments