Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port mapping error while converting ecs to compose #35

Closed
gayathri-menath opened this issue Oct 26, 2015 · 1 comment
Closed

Port mapping error while converting ecs to compose #35

gayathri-menath opened this issue Oct 26, 2015 · 1 comment
Assignees

Comments

@gayathri-menath
Copy link

Consider I have an 'ecs' script snippet

{
    "containerDefinitions": [
        {
            "essential": true, 
            "image": "ctlc/serf", 
            "name": "serf", 
            "portMappings": [
                {
                    "containerPort": 7373
                }, 
                {
                    "containerPort": 7946, 
                    "hostPort": 80
                }
            ]
        }
  ]
}

I tried to convert the above configuration to compose format using the command cat tranform.txt | container-transform --input-type ecs --output-type compose. I got an error like this.

 File "/local/lib/python2.7/site-packages/container_transform/ecs.py", line 113, in _parse_port_mapping
    'host_port': int(mapping['hostPort']),
KeyError: 'hostPort'

After exploring the source code, I could find that you are accessing the hostPort key without checking its presence.

@micahhausler
Copy link
Owner

Thanks for reporting this! I'll take a look at it later this week

@micahhausler micahhausler self-assigned this Oct 26, 2015
micahhausler pushed a commit that referenced this issue Feb 7, 2016
Account for case where only the container port is specified
micahhausler pushed a commit that referenced this issue Feb 7, 2016
Account for case where only the container port is specified
micahhausler added a commit that referenced this issue Feb 8, 2016
* Closes #35
* Closes #33
* Adds support for compose v2
micahhausler added a commit that referenced this issue Feb 8, 2016
* Closes #35
* Closes #33
* Adds support for compose v2
@micahhausler micahhausler mentioned this issue Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants