diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-02-10 11:45:54 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-02-10 11:45:54 +0100 |
commit | 53705bf2b182e88effdd5ec086e04453cdaba99a (patch) | |
tree | e933872bd619024924a3f0a79e10b2178a0d2e65 /configserver | |
parent | ea2913f09faa61641679a8c0a4d28f076bc4e43f (diff) |
Remove use of GENERATE_ROUTING_CONFIG_FOR_TESTER_APPLICATIONS feature flag
Diffstat (limited to 'configserver')
2 files changed, 2 insertions, 19 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java index b648280020f..5f4895c5ae8 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/model/LbServicesProducer.java @@ -9,7 +9,6 @@ import com.yahoo.config.model.api.ServiceInfo; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.Zone; -import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.flags.BooleanFlag; import com.yahoo.vespa.flags.FetchVector; import com.yahoo.vespa.flags.FlagSource; @@ -37,13 +36,11 @@ public class LbServicesProducer implements LbServicesConfig.Producer { private final Map<TenantName, Set<ApplicationInfo>> models; private final Zone zone; private final BooleanFlag use4443Upstream; - private final BooleanFlag generateConfigForTesterApplications; public LbServicesProducer(Map<TenantName, Set<ApplicationInfo>> models, Zone zone, FlagSource flagSource) { this.models = models; this.zone = zone; this.use4443Upstream = Flags.USE_4443_UPSTREAM.bindTo(flagSource); - this.generateConfigForTesterApplications = Flags.GENERATE_ROUTING_CONFIG_FOR_TESTER_APPLICATIONS.bindTo(flagSource); } @Override @@ -65,10 +62,7 @@ public class LbServicesProducer implements LbServicesConfig.Producer { } private boolean generateRoutingConfig(ApplicationId applicationId) { - if (!applicationId.instance().isTester()) return true; - return generateConfigForTesterApplications.with(FetchVector.Dimension.ZONE_ID, - ZoneId.from(zone.environment().value(), zone.region().value()).value()) - .value(); + return ( ! applicationId.instance().isTester()); } private String createLbAppIdKey(ApplicationId applicationId) { diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java index 614ebdf8e47..e0d4bfcf1d5 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/model/LbServicesProducerTest.java @@ -39,7 +39,6 @@ import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @@ -56,7 +55,7 @@ public class LbServicesProducerTest { private static final Set<ContainerEndpoint> endpoints = Set.of( new ContainerEndpoint("mydisc", List.of("rotation-1", "rotation-2")) ); - private InMemoryFlagSource flagSource; + private InMemoryFlagSource flagSource = new InMemoryFlagSource(); private final boolean useGlobalServiceId; @Parameterized.Parameters @@ -66,7 +65,6 @@ public class LbServicesProducerTest { public LbServicesProducerTest(boolean useGlobalServiceId) { this.useGlobalServiceId = useGlobalServiceId; - this.flagSource = new InMemoryFlagSource().withBooleanFlag(Flags.GENERATE_ROUTING_CONFIG_FOR_TESTER_APPLICATIONS.id(), true); } @Test @@ -161,15 +159,6 @@ public class LbServicesProducerTest { assertNull(getLbServicesConfig(Zone.defaultZone(), testModel) .tenants("foo") .applications("baz:prod:default:custom-t")); - - // When flag is to true routing config should be generated for tester app - flagSource = new InMemoryFlagSource().withBooleanFlag(Flags.GENERATE_ROUTING_CONFIG_FOR_TESTER_APPLICATIONS.id(), true); - testModel = createTestModel(new DeployState.Builder()); - conf = getLbServicesConfig(Zone.defaultZone(), testModel); - assertNotNull(conf); - services = conf.tenants("foo").applications("baz:prod:default:custom-t").hosts("foo.baz.yahoo.com").services(QRSERVER.serviceName); - assertThat(services.servicealiases().size(), is(1)); - assertThat(services.endpointaliases().size(), is(2)); } private Map<TenantName, Set<ApplicationInfo>> randomizeApplications(Map<TenantName, Set<ApplicationInfo>> testModel, int seed) { |