Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in kadet prune input handling #982

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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