Skip to content

Commit

Permalink
Merge pull request #982 from kapicorp/fix-kapitan-kadet-prune
Browse files Browse the repository at this point in the history
Fix typo in kadet prune input handling
  • Loading branch information
uberspot authored Mar 31, 2023
2 parents f5fd147 + 0456342 commit 8f01699
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kapitan/inputs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def compile_input_path(self, input_path, comp_obj, ext_vars, **kwargs):
target_name = ext_vars["target"]
output_path = comp_obj["output_path"]
output_type = comp_obj.get("output_type", self.default_output_type())
prune_input = comp_obj.get("prune", kwargs.get("prune", False))
prune_output = comp_obj.get("prune", kwargs.get("prune", False))

logger.debug("Compiling %s", input_path)
try:
Expand All @@ -78,7 +78,7 @@ def compile_input_path(self, input_path, comp_obj, ext_vars, **kwargs):
ext_vars,
output=output_type,
target_name=target_name,
prune_input=prune_input,
prune_output=prune_output,
**kwargs,
)
except KapitanError as e:
Expand Down
2 changes: 1 addition & 1 deletion kapitan/inputs/jsonnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _search_imports(cwd, imp):
output_obj = json.loads(json_output)

output = kwargs.get("output", "yaml")
prune = kwargs.get("prune_input", False)
prune = kwargs.get("prune_output", False)
reveal = kwargs.get("reveal", False)
target_name = kwargs.get("target_name", None)
indent = kwargs.get("indent", 2)
Expand Down
6 changes: 3 additions & 3 deletions kapitan/inputs/kadet.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def compile_file(self, file_path, compile_path, ext_vars, **kwargs):
ext_vars is not used in Kadet
kwargs:
output: default 'yaml', accepts 'json'
prune: default False
prune_output: default False
reveal: default False, set to reveal refs on compile
target_name: default None, set to current target being compiled
indent: default 2
"""
output = kwargs.get("output", "yaml")
prune = kwargs.get("prune", False)
prune_output = kwargs.get("prune_output", False)
reveal = kwargs.get("reveal", False)
target_name = kwargs.get("target_name", None)
# inventory_path = kwargs.get("inventory_path", None)
Expand Down Expand Up @@ -135,7 +135,7 @@ def compile_file(self, file_path, compile_path, ext_vars, **kwargs):
raise CompileError(f"Could not load Kadet module: {spec.name[16:]}")

output_obj = _to_dict(output_obj)
if prune:
if prune_output:
output_obj = prune_empty(output_obj)

# Return None if output_obj has no output
Expand Down

0 comments on commit 8f01699

Please sign in to comment.