@@ -122,10 +122,10 @@ public class DockerComputeDriver extends ComputeServiceDriverBase { | |||||
.withDockerHost(host) | .withDockerHost(host) | ||||
.withDockerTlsVerify(tlsVerify) | .withDockerTlsVerify(tlsVerify) | ||||
.withDockerCertPath(certPath) | .withDockerCertPath(certPath) | ||||
.withRegistryUrl(creds.getParam("registryUrl")) | |||||
.withRegistryUsername(creds.getParam("registryUsername")) | .withRegistryUsername(creds.getParam("registryUsername")) | ||||
.withRegistryPassword(creds.getParam("registryPassword")) | |||||
.withRegistryEmail(creds.getParam("registryEmail")) | .withRegistryEmail(creds.getParam("registryEmail")) | ||||
.withRegistryUrl(creds.getParam("registryUrl")) | |||||
.withRegistryPassword(creds.getParam("registryPassword")) | |||||
.build(); | .build(); | ||||
final DockerHttpClient client = new ZerodepDockerHttpClient.Builder() | final DockerHttpClient client = new ZerodepDockerHttpClient.Builder() | ||||
@@ -23,6 +23,14 @@ import static org.cobbzilla.util.daemon.ZillaRuntime.*; | |||||
@NoArgsConstructor @Accessors(chain=true) @ToString(of={"lat", "lon"}) @OpenApiSchema | @NoArgsConstructor @Accessors(chain=true) @ToString(of={"lat", "lon"}) @OpenApiSchema | ||||
public class GeoLocation { | public class GeoLocation { | ||||
public static final GeoLocation GEO_NEW_YORK = new GeoLocation().setLat("40.661").setLon("-73.944"); | |||||
public static final GeoLocation GEO_SINGAPORE = new GeoLocation().setLat("1.283333").setLon("103.833333"); | |||||
public static final GeoLocation GEO_LONDON = new GeoLocation().setLat("51.507222").setLon("-0.1275"); | |||||
public static final GeoLocation GEO_ATLANTA = new GeoLocation().setLat("33.755").setLon("-84.39"); | |||||
public static final GeoLocation GEO_CHICAGO = new GeoLocation().setLat("41.881944").setLon("-87.627778"); | |||||
public static final GeoLocation DEFAULT_GEO_LOCATION = GEO_ATLANTA; | |||||
public static final GeoLocation NULL_LOCATION = new GeoLocation().setLat("-1.0").setLon("-1.0"); | public static final GeoLocation NULL_LOCATION = new GeoLocation().setLat("-1.0").setLon("-1.0"); | ||||
public static final double INVALID_LOCATION = -1.0; | public static final double INVALID_LOCATION = -1.0; | ||||
@@ -16,8 +16,7 @@ import java.util.Collection; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
import static bubble.cloud.geoLocation.GeoLocation.INVALID_LOCATION; | |||||
import static bubble.cloud.geoLocation.GeoLocation.NULL_LOCATION; | |||||
import static bubble.cloud.geoLocation.GeoLocation.*; | |||||
import static java.util.Comparator.comparingDouble; | import static java.util.Comparator.comparingDouble; | ||||
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; | import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; | ||||
@@ -75,7 +74,7 @@ public interface RegionalServiceDriver { | |||||
if (latLonIsValid && latitude >= 0 && longitude >= 0) { | if (latLonIsValid && latitude >= 0 && longitude >= 0) { | ||||
r.setDistance(latitude, longitude); | r.setDistance(latitude, longitude); | ||||
} else { | } else { | ||||
r.setDistance(0); | |||||
r.setDistance(DEFAULT_GEO_LOCATION.getLatitude(), DEFAULT_GEO_LOCATION.getLongitude()); | |||||
} | } | ||||
allRegions.add(r); | allRegions.add(r); | ||||
} | } | ||||
@@ -1 +1 @@ | |||||
Subproject commit 159e6b71475c261c68555dbe776193fdd6e06cdb | |||||
Subproject commit a4c4042df88abfd6a02e5dfd30f3ca8f883d8fbf |
@@ -13,16 +13,12 @@ import org.junit.Test; | |||||
import java.util.*; | import java.util.*; | ||||
import static bubble.cloud.geoLocation.GeoLocation.*; | |||||
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
public class FlexRouterProximityComparatorTest { | public class FlexRouterProximityComparatorTest { | ||||
public static final GeoLocation GEO_NULL = new GeoLocation().setLat(null).setLon(null); | public static final GeoLocation GEO_NULL = new GeoLocation().setLat(null).setLon(null); | ||||
public static final GeoLocation GEO_NEW_YORK = new GeoLocation().setLat("40.661").setLon("-73.944"); | |||||
public static final GeoLocation GEO_SINGAPORE = new GeoLocation().setLat("1.283333").setLon("103.833333"); | |||||
public static final GeoLocation GEO_LONDON = new GeoLocation().setLat("51.507222").setLon("-0.1275"); | |||||
public static final GeoLocation GEO_ATLANTA = new GeoLocation().setLat("33.755").setLon("-84.39"); | |||||
public static final GeoLocation GEO_CHICAGO = new GeoLocation().setLat("41.881944").setLon("-87.627778"); | |||||
private static FlexRouter router(int port) { | private static FlexRouter router(int port) { | ||||
return new FlexRouter().setPort(port).setIp("127.0.0."+port); | return new FlexRouter().setPort(port).setIp("127.0.0."+port); | ||||
@@ -5,7 +5,7 @@ | |||||
"response": { | "response": { | ||||
"store": "computeClouds", | "store": "computeClouds", | ||||
"check": [ | "check": [ | ||||
{"condition": "json.length == 3"} | |||||
{"condition": "json.length == 4"} | |||||
] | ] | ||||
} | } | ||||
}, | }, | ||||