Skip to content

Commit 106e977

Browse files
authored
Merge pull request #4 from funkwerk/feature/udp_ports
added support for udp ports
2 parents c5da29f + 85b0461 commit 106e977

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

compose_plantuml/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def boundaries(self, compose, group=False, ports=True, volumes=True, notes=False
7474
port_uml = ''
7575
port_links = ''
7676
for service, host, container in sorted(self.ports(compose)):
77-
port = host
77+
port = host.replace('/', '')
7878
if container is not None:
7979
port = '{0} : {1}'.format(host, container)
8080
port_links += '[{0}] --> {1}\n'.format(service, port)

features/boundaries.feature

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Feature: Boundaries
33
I want to see the boundaries of a system
44
so that I know how to interact with it.
55

6-
Scenario: Exposed ports
6+
Scenario Outline: Exposed ports
77
Given a file named "compose.yml" with:
88
"""
99
version: "2"
1010
services:
1111
service:
1212
ports:
13-
- 8080
13+
- <port>
1414
"""
1515
When I run `bin/compose_plantuml --boundaries compose.yml`
1616
Then it should pass with exactly:
@@ -19,29 +19,21 @@ Feature: Boundaries
1919
cloud system {
2020
[service]
2121
}
22-
[service] --> 8080
22+
[service] --> <resulting port>
2323
2424
"""
2525

26-
Scenario: Alias Ports
27-
Given a file named "compose.yml" with:
28-
"""
29-
version: "2"
30-
services:
31-
service:
32-
ports:
33-
- 8080:80
34-
"""
35-
When I run `bin/compose_plantuml --boundaries compose.yml`
36-
Then it should pass with exactly:
37-
"""
38-
skinparam componentStyle uml2
39-
cloud system {
40-
[service]
41-
}
42-
[service] --> 8080 : 80
26+
Examples: TCP Port
27+
| port | resulting port |
28+
| 8080 | 8080 |
4329

44-
"""
30+
Examples: UDP Port
31+
| port | resulting port |
32+
| 8080/udp | 8080udp |
33+
34+
Examples: Alias Port
35+
| port | resulting port |
36+
| 8080:80 | 8080 : 80 |
4537

4638
Scenario: Volumes
4739
Given a file named "compose.yml" with:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def readme():
77

88
setup(
99
name='compose_plantuml',
10-
version='0.0.13',
10+
version='0.1.0',
1111
description='converts docker-compose into plantuml',
1212
long_description=readme(),
1313
url='http://github.com/funkwerk/compose_plantuml',

0 commit comments

Comments
 (0)