From eb69e48bbfbfd714e75b7db6848b89eb5cd12ebb Mon Sep 17 00:00:00 2001 From: Alessandro De Maria Date: Mon, 20 Mar 2023 12:19:15 +0000 Subject: [PATCH 1/2] Fix 972: handle compose_node_name --- kapitan/targets.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kapitan/targets.py b/kapitan/targets.py index a805c69f6..f8312a17c 100644 --- a/kapitan/targets.py +++ b/kapitan/targets.py @@ -167,11 +167,13 @@ def compile_targets( os.makedirs(compile_path, exist_ok=True) + # if '-t' is set on compile or only a few changed, only override selected targets if updated_targets: - for target in updated_targets: - compile_path_target = os.path.join(compile_path, target) - temp_path_target = os.path.join(temp_compile_path, target) + for target in target_objs: + path = target["target_full_path"] + compile_path_target = os.path.join(compile_path, path) + temp_path_target = os.path.join(temp_compile_path, path) os.makedirs(compile_path_target, exist_ok=True) @@ -404,7 +406,7 @@ def load_target_inventory(inventory_path, targets, ignore_class_notfound=False): raise InventoryError( "InventoryError: {}: parameters.kapitan has no assignment".format(target_name) ) - target_obj["target_full_path"] = inv_target["__reclass__"]["node"].replace("./", "") + target_obj["target_full_path"] = inv_target["parameters"]["_reclass_"]["name"]["path"] require_compile = not ignore_class_notfound valid_target_obj(target_obj, require_compile) validate_matching_target_name(target_name, target_obj, inventory_path) From adec3a06a90b800b0be1cefe9b340b7605a44027 Mon Sep 17 00:00:00 2001 From: Alessandro De Maria Date: Mon, 20 Mar 2023 12:21:05 +0000 Subject: [PATCH 2/2] Fix 972: handle compose_node_name --- kapitan/targets.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kapitan/targets.py b/kapitan/targets.py index f8312a17c..7327fb7d8 100644 --- a/kapitan/targets.py +++ b/kapitan/targets.py @@ -167,7 +167,6 @@ def compile_targets( os.makedirs(compile_path, exist_ok=True) - # if '-t' is set on compile or only a few changed, only override selected targets if updated_targets: for target in target_objs: