Skip to content

Commit

Permalink
fix: Sync repos before listing apps
Browse files Browse the repository at this point in the history
  • Loading branch information
allanger committed May 7, 2023
1 parent edbab40 commit 52a3be2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ fn main() {
env_logger::init();
let args = Args::parse();
let mut result: Vec<ExecResult> = Vec::new();

let charts = match args.kind {
Kinds::Argo => Argo::init().get_app(),
Kinds::Helm => Helm::init().get_app(),
Kinds::Helmfile => Helmfile::init(args.path.clone(), args.helmfile_environment.clone()).get_app(),
}
.unwrap();


if !args.no_sync {
info!("syncing helm repositories");
let res = match args.kind {
Kinds::Argo => Argo::init().sync_repos(),
Kinds::Helm => Helm::init().sync_repos(),
Kinds::Helmfile => Helmfile::init(args.path, args.helmfile_environment).sync_repos(),
Kinds::Helmfile => Helmfile::init(args.path.clone(), args.helmfile_environment.clone()).sync_repos(),
};
match res {
Ok(_) => info!("helm repos are synced"),
Err(err) => error!("couldn't sync repos', {}", err),
}
}

let charts = match args.kind {
Kinds::Argo => Argo::init().get_app(),
Kinds::Helm => Helm::init().get_app(),
Kinds::Helmfile => Helmfile::init(args.path.clone(), args.helmfile_environment.clone()).get_app(),
}
.unwrap();

charts.iter().for_each(|a| {
debug!("{:?}", a);
check_chart(&mut result, a).unwrap();
Expand Down

0 comments on commit 52a3be2

Please sign in to comment.