Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
eirmich committed Dec 24, 2024
1 parent 67dfed5 commit fca2919
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions checkov/kubernetes/parser/k8_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ def load(filename: Path) -> Tuple[List[Dict[str, Any]], List[Tuple[int, str]]]:
"""
Load the given YAML file
"""
helm_template_patterns = [ r'\{\{-?\s*\.Release\.', r'\{\{-?\s*\.Values\.', r'\{\{-?\s*if\s', r'\{\{-?\s*end\s', r'\{\{-?\s*with\s' ]
helm_template_patterns = [r"\{\{-?\s*\.Release\.", r"\{\{-?\s*\.Values\.",
r"\{\{-?\s*if\s", r"\{\{-?\s*end\s", r"\{\{-?\s*with\s"]

content = read_file_with_any_encoding(file_path=filename)

if not all(key in content for key in ("apiVersion", "kind")):
return [{}], []

for pattern in helm_template_patterns:
for pattern in helm_template_patterns:
if re.search(pattern, content):
return [{}], []

Expand Down

0 comments on commit fca2919

Please sign in to comment.