Skip to content

Add a "defaultPortMapping" option which exposes all Mesos provided ports#1036

Merged
ssalinas merged 5 commits intoHubSpot:masterfrom
stevenschlansker:default-network-mapping
May 17, 2016
Merged

Add a "defaultPortMapping" option which exposes all Mesos provided ports#1036
ssalinas merged 5 commits intoHubSpot:masterfrom
stevenschlansker:default-network-mapping

Conversation

@stevenschlansker
Copy link
Copy Markdown
Contributor

Our apps generally ask for 1 or 2 ports. It's a pain to repeatedly write

      "portMappings": [
        {"hostPort": 0, "hostPortType": "FROM_OFFER", "containerPort": 0, "containerPortType": "FROM_OFFER"},
        {"hostPort": 1, "hostPortType": "FROM_OFFER", "containerPort": 1, "containerPortType": "FROM_OFFER"}
      ]

so why not just let Singularity fill it in for you?

dockerInfoBuilder.addPortMappings(maybePortMapping.get());
}
}
} else if (configuration.getNetworkConfiguration().isDefaultPortMapping() && dockerInfo.get().getPortMappings().isEmpty() && ports.isPresent()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also need to check that network mode is BRIDGE here, if it's HOST or NONE and you specify mappings believe that will end up at least in a TASK_FAILED if not a TASK_ERROR. Other than that looks good

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ssalinas ssalinas modified the milestone: 0.6.0 May 13, 2016
@ssalinas
Copy link
Copy Markdown
Contributor

Tested this in our staging infra and looks good 👍

@stevenschlansker
Copy link
Copy Markdown
Contributor Author

Test failure looks transient, timed out on the openjdk7 build.

@tpetr
Copy link
Copy Markdown
Contributor

tpetr commented May 17, 2016

LGTM

@ssalinas ssalinas merged commit 0408b28 into HubSpot:master May 17, 2016
@stevenschlansker stevenschlansker deleted the default-network-mapping branch February 10, 2017 23:33
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

Successfully merging this pull request may close these issues.

3 participants