From 03703ccdb79893808c399cd644eb88eb8f65d61c Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Fri, 19 Jan 2024 14:51:11 -0500 Subject: [PATCH] smooth over --- lib/krane/deploy_task.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/krane/deploy_task.rb b/lib/krane/deploy_task.rb index a1274ed61..bf6471c4e 100644 --- a/lib/krane/deploy_task.rb +++ b/lib/krane/deploy_task.rb @@ -288,7 +288,11 @@ def validate_resources(resources) validate_globals(resources) resources.select! { |r| r.selected?(@selector) } if @selector_as_filter applyables, individuals = resources.partition { |r| r.deploy_method == :apply } - batch_dry_run_success = validate_dry_run(applyables) + begin + batch_dry_run_success = validate_dry_run(applyables) + rescue FatalDeploymentError => e + raise FatalDeploymentError, "Template validation failed" + end Krane::Concurrency.split_across_threads(resources) do |r| # No need to pass in kubectl (and do per-resource dry run apply) if batch dry run succeeded r.validate_definition(kubectl: nil, selector: @selector, dry_run: false)