Skip to content

Commit

Permalink
Fix port regex in docker-compose plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Simon committed Sep 24, 2024
1 parent e7ad256 commit 2adcb0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ docs/_build/*
.cfgnet
.idea/*
.vscode
env/*
env/*
*.env
8 changes: 4 additions & 4 deletions src/cfgnet/plugins/concept/docker_compose_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def _parse_scalar_node(self, node, parent):
if node.value != "":
match = DockerComposePlugin.ports.match(node.value)
if match is not None:
port_in = ValueNode(name=match.group("host"))
port_out = ValueNode(name=match.group("container"))
port_in = ValueNode(name=match.group("in"))
port_out = ValueNode(name=match.group("out"))
option_port_in = OptionNode(
"host", node.start_mark.line + 1, ConfigType.PORT
"in", node.start_mark.line + 1, ConfigType.PORT
)
option_port_out = OptionNode(
"container", node.start_mark.line + 1, ConfigType.PORT
"out", node.start_mark.line + 1, ConfigType.PORT
)
parent.add_child(option_port_in)
parent.add_child(option_port_out)
Expand Down

0 comments on commit 2adcb0e

Please sign in to comment.