apply: Don't enforce meta.allowApplyAll for builds

Fixes #99.
This commit is contained in:
Zhaofeng Li 2022-06-24 17:34:37 -07:00
parent 0209b6dc40
commit 432d4212fc

View file

@ -147,11 +147,14 @@ pub async fn run(_global_args: &ArgMatches, local_args: &ArgMatches) -> Result<(
let ssh_config = env::var("SSH_CONFIG_FILE")
.ok().map(PathBuf::from);
let goal_arg = local_args.value_of("goal").unwrap();
let goal = Goal::from_str(goal_arg).unwrap();
let filter = local_args.value_of("on")
.map(NodeFilter::new)
.transpose()?;
if !filter.is_some() {
if !filter.is_some() && goal != Goal::Build {
// User did not specify node, we should check meta and see rules
let meta = hive.get_meta_config().await?;
if !meta.allow_apply_all {
@ -161,9 +164,6 @@ pub async fn run(_global_args: &ArgMatches, local_args: &ArgMatches) -> Result<(
}
}
let goal_arg = local_args.value_of("goal").unwrap();
let goal = Goal::from_str(goal_arg).unwrap();
let targets = hive.select_nodes(filter, ssh_config, goal.requires_target_host()).await?;
let n_targets = targets.len();