@@ -6,7 +6,7 @@ use crate::{
66 agent_control:: start_agent_control_with_custom_config, retry:: retry, runtime:: tokio_runtime,
77 } ,
88 on_host:: tools:: {
9- config:: { create_agent_control_config , create_file, create_local_config} ,
9+ config:: { AgentControlConfigBuilder , create_file, create_local_config} ,
1010 custom_agent_type:: DYNAMIC_AGENT_TYPE_FILENAME ,
1111 } ,
1212} ;
@@ -58,12 +58,9 @@ deployment:
5858"#
5959 ) ;
6060
61- create_agent_control_config (
62- opamp_server. endpoint ( ) ,
63- opamp_server. jwks_endpoint ( ) ,
64- agents. to_string ( ) ,
65- local_dir. to_path_buf ( ) ,
66- ) ;
61+ AgentControlConfigBuilder :: basic ( opamp_server. endpoint ( ) , opamp_server. jwks_endpoint ( ) )
62+ . with_agents ( agents. to_string ( ) )
63+ . write ( local_dir. to_path_buf ( ) ) ;
6764 create_local_config (
6865 agent_id. to_string ( ) ,
6966 NO_CONFIG . to_string ( ) ,
@@ -172,17 +169,14 @@ deployment:
172169 ) ;
173170
174171 // Create AC config
175- create_agent_control_config (
176- opamp_server. endpoint ( ) ,
177- opamp_server. jwks_endpoint ( ) ,
178- format ! (
172+ AgentControlConfigBuilder :: basic ( opamp_server. endpoint ( ) , opamp_server. jwks_endpoint ( ) )
173+ . with_agents ( format ! (
179174 r#"
180175 {agent_id}:
181176 agent_type: "test/test:0.0.0"
182177"#
183- ) ,
184- local_dir. to_path_buf ( ) ,
185- ) ;
178+ ) )
179+ . write ( local_dir. to_path_buf ( ) ) ;
186180 // Values. Contains 3 variables: a YAML, a string, and a map[string]yaml (to create files in a directory)
187181 create_local_config (
188182 agent_id. to_string ( ) ,
@@ -337,12 +331,9 @@ deployment:
337331"#
338332 ) ;
339333
340- create_agent_control_config (
341- opamp_server. endpoint ( ) ,
342- opamp_server. jwks_endpoint ( ) ,
343- agents. to_string ( ) ,
344- local_dir. to_path_buf ( ) ,
345- ) ;
334+ AgentControlConfigBuilder :: basic ( opamp_server. endpoint ( ) , opamp_server. jwks_endpoint ( ) )
335+ . with_agents ( agents. to_string ( ) )
336+ . write ( local_dir. to_path_buf ( ) ) ;
346337
347338 create_local_config (
348339 agent_id. to_string ( ) ,
0 commit comments