diff options
author | Martin Polden <mpolden@mpolden.no> | 2018-12-17 15:11:30 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2018-12-17 15:12:18 +0100 |
commit | fd4f35fdc2c1991617037bc8d252c2ce57900005 (patch) | |
tree | 4b656aa5db8e1a1bcb5a9e3d04e77a3c7eaa77d4 /controller-server | |
parent | b3e51f84ba5c8bc01c8bbff84621e82a375b54f2 (diff) |
Remove special handling of corp zones
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java | 8 | ||||
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepositoryTest.java (renamed from controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java) | 38 |
2 files changed, 2 insertions, 44 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java index 6820c4ba6b6..a22e5259919 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.rotation; -import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.provision.Environment; import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.ApplicationController; @@ -69,8 +68,6 @@ public class RotationRepository { } long productionZones = application.deploymentSpec().zones().stream() .filter(zone -> zone.deploysTo(Environment.prod)) - // Global rotations don't work for nodes in corp network - .filter(zone -> !isCorp(zone)) .count(); if (productionZones < 2) { throw new IllegalArgumentException("global-service-id is set but less than 2 prod zones are defined"); @@ -104,11 +101,6 @@ public class RotationRepository { return allRotations.get(rotation); } - // TODO: Remove after corp zones disappear - private static boolean isCorp(DeploymentSpec.DeclaredZone zone) { - return zone.region().isPresent() && zone.region().get().value().contains("corp"); - } - /** Returns a immutable map of rotation ID to rotation sorted by rotation ID */ private static Map<RotationId, Rotation> from(RotationsConfig rotationConfig) { return rotationConfig.rotations().entrySet().stream() diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepositoryTest.java index 1d5ddaa1ec0..666c7774cf5 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepositoryTest.java @@ -4,7 +4,6 @@ package com.yahoo.vespa.hosted.controller.rotation; import com.yahoo.config.provision.SystemName; import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.ControllerTester; -import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; import com.yahoo.vespa.hosted.controller.application.ApplicationPackage; import com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder; import com.yahoo.vespa.hosted.controller.deployment.DeploymentTester; @@ -24,7 +23,7 @@ import static org.junit.Assert.assertFalse; * @author Oyvind Gronnesby * @author mpolden */ -public class RotationTest { +public class RotationRepositoryTest { @Rule public ExpectedException thrown = ExpectedException.none(); @@ -145,40 +144,6 @@ public class RotationTest { } @Test - public void application_with_only_one_non_corp_region() { - tester.controllerTester().zoneRegistry().setZones(ZoneId.from("prod", "corp-us-east-1"), - ZoneId.from("prod", "us-east-3")); - ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") - .region("us-east-3") - .region("corp-us-east-1") - .build(); - Application application = tester.createApplication("app2", "tenant2", 22L, - 2L); - thrown.expect(RuntimeException.class); - thrown.expectMessage("less than 2 prod zones are defined"); - tester.deployCompletely(application, applicationPackage); - } - - @Test - public void application_with_corp_region_and_two_non_corp_region() { - tester.controllerTester().zoneRegistry().setZones(ZoneId.from("prod", "corp-us-east-1"), - ZoneId.from("prod", "us-east-3"), - ZoneId.from("prod", "us-west-1")); - ApplicationPackage applicationPackage = new ApplicationPackageBuilder() - .globalServiceId("foo") - .region("us-east-3") - .region("corp-us-east-1") - .region("us-west-1") - .build(); - Application application = tester.createApplication("app2", "tenant2", 22L, - 2L); - tester.deployCompletely(application, applicationPackage); - assertEquals(new RotationId("foo-1"), tester.applications().require(application.id()) - .rotation().get()); - } - - @Test public void prefixes_system_when_not_main() { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .globalServiceId("foo") @@ -193,4 +158,5 @@ public class RotationTest { assertEquals("https://cd--app2--tenant2.global.vespa.yahooapis.com:4443/", tester.applications().require(application.id()) .globalDnsName(SystemName.cd).get().secureUrl().toString()); } + } |