> + }
> +
> + private int getLoginPort(Container container) {
> + if (container.getNetworkSettings() != null) {
> + Map<String, List<Map<String,String>>> ports =
> container.getNetworkSettings().getPorts();
> + if(ports != null) {
> + return
> Integer.parseInt(getOnlyElement(ports.get("22/tcp")).get("HostPort"));
> + }
> + } else if (container.getPorts() != null) {
> + for (Port port : container.getPorts()) {
> + if (port.getPrivatePort() == 22) {
> + return port.getPublicPort();
> + }
> + }
> + }
> + throw new IllegalStateException("Cannot determine the login port for "
> + container.getId());
Is it ok to fail here? By default, jclouds will assume port 22 as a login port.
If we can't detect it, should we fail, or let jclouds try to use port 22 anyway?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/57/files#r10839133