From 432d4212fc14d846c1de0c0dd90a694c8d36a861 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 24 Jun 2022 17:34:37 -0700 Subject: [PATCH] apply: Don't enforce `meta.allowApplyAll` for builds Fixes #99. --- src/command/apply.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/command/apply.rs b/src/command/apply.rs index fcab351..ba6437d 100644 --- a/src/command/apply.rs +++ b/src/command/apply.rs @@ -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();