Skip to content

Commit

Permalink
When a container exposes a port that we do not map, ignore the port
Browse files Browse the repository at this point in the history
  • Loading branch information
hartmans committed Feb 6, 2025
1 parent c49574c commit c28412f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion carthage/podman/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ async def find(self):
self.container_info = containers[0]
ports = self.container_info['NetworkSettings']['Ports']
if not hasattr(self, 'ssh_port') and '22/tcp' in ports:
self.ssh_port = ports['22/tcp'][0]['HostPort']
if ports['22/tcp']:
self.ssh_port = ports['22/tcp'][0]['HostPort']
self.id = self.container_info['Id']
self.running = self.container_info['State']['Running']
try:
Expand Down

0 comments on commit c28412f

Please sign in to comment.