Skip to content

Commit fcd8b0d

Browse files
committed
Fix pasring dockerfiles
1 parent 2ffc8e6 commit fcd8b0d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cfgnet/plugins/concept/docker_plugin.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import os
1717
import re
18-
18+
import logging
1919
from typing import List, Optional
2020
import dockerfile
2121
from cfgnet.config_types.config_types import ConfigType
@@ -67,7 +67,13 @@ def _parse_config_file(
6767
)
6868

6969
self.env_vars.clear()
70-
data = dockerfile.parse_file(abs_file_path)
70+
try:
71+
data = dockerfile.parse_file(abs_file_path)
72+
except dockerfile.GoParseError as error:
73+
logging.warning(
74+
"Invalid Dockerfile %s: %s", abs_file_path, error
75+
)
76+
return artifact
7177

7278
for cmd in data:
7379
option = self.create_option(name=cmd.cmd, location=cmd.start_line)

0 commit comments

Comments
 (0)