Skip to content

Commit de7e344

Browse files
committed
support udp also for interfaces
1 parent 106e977 commit de7e344

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

compose_plantuml/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ 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.replace('/', '')
77+
port = host
7878
if container is not None:
7979
port = '{0} : {1}'.format(host, container)
80+
host = host.replace('/', '')
81+
port = port.replace('/', '')
8082
port_links += '[{0}] --> {1}\n'.format(service, port)
8183
port_uml += 'interface {0}\n'.format(host)
8284
result += self.group('ports', port_uml) if group else ''

features/boundaries.feature

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Feature: Boundaries
8787
8888
"""
8989

90-
Scenario: Group Volumes and Ports
90+
Scenario Outline: Group Volumes and Ports
9191
Given a file named "compose.yml" with:
9292
"""
9393
version: "2"
@@ -96,7 +96,7 @@ Feature: Boundaries
9696
volumes:
9797
- service_log:/log
9898
ports:
99-
- 8080:80
99+
- <port>:80
100100
unused_service: {}
101101
volumes:
102102
service_log: {}
@@ -115,13 +115,21 @@ Feature: Boundaries
115115
}
116116
}
117117
package ports {
118-
interface 8080
118+
interface <resulting port>
119119
}
120-
[service] --> 8080 : 80
120+
[service] --> <resulting port> : 80
121121
[service] --> volume_1
122122
123123
"""
124124

125+
Examples: TCP Pport
126+
| port | resulting port |
127+
| 8080 | 8080 |
128+
129+
Examples: UDP Pport
130+
| port | resulting port |
131+
| 8080/udp | 8080udp |
132+
125133
Scenario: Notes
126134
Given a file named "compose.yml" with:
127135
"""

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.1.0',
10+
version='0.1.1',
1111
description='converts docker-compose into plantuml',
1212
long_description=readme(),
1313
url='http://github.com/funkwerk/compose_plantuml',

0 commit comments

Comments
 (0)