Skip to content

Commit

Permalink
Merge branch 'main' into fix/CKV_AWS_342
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden authored Jul 12, 2023
2 parents 2e703b3 + d92323f commit 085136c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion checkov/kustomize/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,20 @@ def _get_caller_line_range(self, root_folder: str, k8_file: str, origin_relative
if caller_file_path not in self.definitions:
return None
caller_resource = self.definitions[caller_file_path][0]

if caller_file_path not in self.definitions_raw:
# As we cannot calculate better lines with the `calculate_code_lines` without the raw code,
# we can use the existing info in the resource
return caller_resource[START_LINE], caller_resource[END_LINE]

raw_caller_resource = self.definitions_raw[caller_file_path]

caller_raw_start_line = caller_resource[START_LINE]
caller_raw_end_line = min(caller_resource[END_LINE], len(raw_caller_resource))

_, caller_start_line, caller_end_line = calculate_code_lines(raw_caller_resource, caller_raw_start_line,
caller_raw_end_line)
return (caller_start_line, caller_end_line)
return caller_start_line, caller_end_line

def line_range(self, code_lines: list[tuple[int, str]]) -> list[int]:
num_of_lines = len(code_lines)
Expand Down
2 changes: 1 addition & 1 deletion checkov/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '2.3.318'
version = '2.3.319'
2 changes: 1 addition & 1 deletion kubernetes/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
checkov==2.3.318
checkov==2.3.319

0 comments on commit 085136c

Please sign in to comment.