Skip to content

Commit

Permalink
Check for origin_relative_path before concat
Browse files Browse the repository at this point in the history
  • Loading branch information
bo156 committed Jul 10, 2023
1 parent abaac96 commit e4bf7f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion checkov/kustomize/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ def mutate_kubernetes_results(
return report

def _get_caller_file_info(self, entity_context: _EntityContext, k8_file: str, k8_file_path: str, resource_id: str,
root_folder: str | None) -> tuple[tuple[int, int] | None, str]:
root_folder: str | None) -> tuple[tuple[int, int] | None, str | None]:
origin_relative_path = entity_context['origin_relative_path']
if origin_relative_path is None:
return None, None
k8s_file_dir = pathlib.Path(k8_file_path).parent
raw_file_path = k8s_file_dir / origin_relative_path
caller_file_path = self._get_caller_file_path(k8s_file_dir, origin_relative_path, raw_file_path)
Expand Down

0 comments on commit e4bf7f7

Please sign in to comment.