Skip to content

Commit

Permalink
Merge pull request #1141 from projectsyn/fix/inventory-caching
Browse files Browse the repository at this point in the history
Don't call `render_targets()` from `get_targets()` when all requested targets are cached
  • Loading branch information
MatteoVoges authored Feb 21, 2024
2 parents cd2e2f8 + 249fd84 commit 6b4a02c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kapitan/inventory/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def get_targets(self, target_names: list, ignore_class_not_found: bool = False)
if not target.parameters:
targets_to_render.append(target)

self.render_targets(targets_to_render, ignore_class_not_found)
if targets_to_render:
self.render_targets(targets_to_render, ignore_class_not_found)

return {name: target for name, target in self.targets.items() if name in target_names}

Expand Down

0 comments on commit 6b4a02c

Please sign in to comment.