Skip to content

Commit

Permalink
Merge branch 'main' into create-tf-resource_subgraph_maps
Browse files Browse the repository at this point in the history
# Conflicts:
#	checkov/terraform/runner.py
  • Loading branch information
YaaraVerner committed Oct 2, 2023
2 parents 9cc7bdd + bbd182c commit 6bfab2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions checkov/terraform/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
graph_manager: TerraformGraphManager | None = None,
) -> None:
super().__init__(parser, db_connector, external_registries, source, graph_class, graph_manager)
self.all_graphs: list[tuple[LibraryGraph, str]] = []
self.all_graphs: list[tuple[LibraryGraph, Optional[str]]] = []
self.resource_subgraph_map: Optional[dict[str, str]] = None

def run(
Expand All @@ -74,7 +74,7 @@ def run(
report = Report(self.check_type)
parsing_errors: dict[str, Exception] = {}
self.load_external_checks(external_checks_dir)
local_graphs = None
local_graphs: Optional[list[tuple[Optional[str], Optional[TerraformLocalGraph]]]] = None
if self.context is None or self.definitions is None or self.breadcrumbs is None:
self.definitions = {}
logging.info("Scanning root folder and producing fresh tf_definitions and context")
Expand Down Expand Up @@ -109,7 +109,7 @@ def run(
create_graph=CHECKOV_CREATE_GRAPH,
)
# Make graph a list to allow single processing method for all cases
local_graphs = [('', single_graph)]
local_graphs = [(None, single_graph)]
elif files:
files = [os.path.abspath(file) for file in files]
root_folder = os.path.split(os.path.commonprefix(files))[0]
Expand All @@ -122,7 +122,7 @@ def run(
)
else:
# local_graph needs to be a list to allow supporting multi graph
local_graphs = [('', self.graph_manager.build_graph_from_definitions(self.definitions))]
local_graphs = [(None, self.graph_manager.build_graph_from_definitions(self.definitions))]
else:
raise Exception("Root directory was not specified, files were not specified")

Expand Down Expand Up @@ -191,7 +191,7 @@ def parse_file(file: str) -> tuple[str, dict[str, Any] | None, dict[str, Excepti
parsing_errors.update(file_parsing_errors)

def _update_definitions_and_breadcrumbs(
self, local_graphs: list[tuple[str, TerraformLocalGraph]], report: Report, root_folder: str
self, local_graphs: list[tuple[Optional[str], TerraformLocalGraph]], report: Report, root_folder: str
) -> None:
self.definitions = {}
self.breadcrumbs = {}
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.4.58'
version = '2.4.59'
2 changes: 1 addition & 1 deletion kubernetes/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
checkov==2.4.58
checkov==2.4.59

0 comments on commit 6bfab2f

Please sign in to comment.