@@ -13,7 +13,8 @@ use crate::config_migrate::migration::defaults::NEWRELIC_INFRA_AGENT_TYPE_CONFIG
1313use crate :: config_migrate:: migration:: migrator:: { ConfigMigrator , MigratorError } ;
1414use crate :: config_migrate:: migration:: persister:: legacy_config_renamer:: LegacyConfigRenamer ;
1515use crate :: config_migrate:: migration:: persister:: values_persister_file:: ValuesPersisterFile ;
16- use crate :: values:: file:: ConfigRepositoryFile ;
16+ use crate :: on_host:: file_store:: FileStore ;
17+ use crate :: values:: ConfigRepo ;
1718use std:: path:: { Path , PathBuf } ;
1819use std:: sync:: Arc ;
1920use tracing:: { debug, info, warn} ;
@@ -79,7 +80,10 @@ impl InfraConfigGenerator {
7980
8081 fn create_new_infra_values ( & self , infra_config : InfraConfig ) -> Result < ( ) , CliError > {
8182 info ! ( "Creating new infra agent configuration" ) ;
82- let vr = ConfigRepositoryFile :: new ( self . local_dir . clone ( ) , self . remote_dir . clone ( ) ) ;
83+ let vr = ConfigRepo :: new ( Arc :: new ( FileStore :: new_local_fs (
84+ self . local_dir . clone ( ) ,
85+ self . remote_dir . clone ( ) ,
86+ ) ) ) ;
8387 let sa_local_config_loader = AgentControlConfigStore :: new ( Arc :: new ( vr) ) ;
8488
8589 let config_getter = AgentConfigGetter :: new ( sa_local_config_loader) ;
@@ -118,7 +122,10 @@ impl InfraConfigGenerator {
118122 let config = MigrationConfig :: parse ( modified_yaml. as_str ( ) )
119123 . map_err ( |err| CliError :: Command ( format ! ( "error parsing migration config: {err}" ) ) ) ?;
120124
121- let vr = ConfigRepositoryFile :: new ( self . local_dir . clone ( ) , self . remote_dir . clone ( ) ) ;
125+ let vr = ConfigRepo :: new ( Arc :: new ( FileStore :: new_local_fs (
126+ self . local_dir . clone ( ) ,
127+ self . remote_dir . clone ( ) ,
128+ ) ) ) ;
122129 let sa_local_config_loader = AgentControlConfigStore :: new ( Arc :: new ( vr) ) ;
123130 let config_migrator = ConfigMigrator :: new (
124131 ConfigConverter :: default ( ) ,
@@ -169,7 +176,6 @@ mod tests {
169176 use crate :: agent_control:: defaults:: {
170177 AGENT_CONTROL_ID , FOLDER_NAME_LOCAL_DATA , STORE_KEY_LOCAL_DATA_CONFIG ,
171178 } ;
172- use crate :: opamp:: instance_id:: on_host:: storer:: build_config_name;
173179 use std:: fs;
174180 use std:: fs:: create_dir_all;
175181 use tempfile:: TempDir ;
@@ -195,6 +201,8 @@ agents:
195201 #[ test]
196202 fn test_migrate_old_infra_config ( ) {
197203 // Create a temporary directory
204+
205+ use crate :: on_host:: file_store:: build_config_name;
198206 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
199207 let infra_file_path = temp_dir. path ( ) . join ( "newrelic-infra.yml" ) ;
200208 let agents_file_path = temp_dir
@@ -264,6 +272,8 @@ config_agent:
264272 #[ cfg( target_family = "unix" ) ] //TODO This should be removed when Windows support is added (DirectoryManager unimplemented)
265273 #[ test]
266274 fn test_generate_new_infra_config ( ) {
275+ use crate :: on_host:: file_store:: build_config_name;
276+
267277 let temp_dir = TempDir :: new ( ) . unwrap ( ) ;
268278 let agents_file_path = temp_dir
269279 . path ( )
0 commit comments