diff options
author | Harald Musum <musum@verizonmedia.com> | 2022-01-17 18:50:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 18:50:33 +0100 |
commit | 6d6853577ac06f1470db0a23481152fe3277a286 (patch) | |
tree | b5b633d2b3aa32227185fba6cf4972d9fff4e825 /service-monitor | |
parent | 64ef088e77b389c2488e5f9be1e9c60888bd7c29 (diff) |
Revert "Remove dev system"
Diffstat (limited to 'service-monitor')
3 files changed, 27 insertions, 5 deletions
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DevHostApplication.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DevHostApplication.java new file mode 100644 index 00000000000..e522b736290 --- /dev/null +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DevHostApplication.java @@ -0,0 +1,13 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.service.duper; + +import com.yahoo.vespa.applicationmodel.InfrastructureApplication; + +/** + * @author mortent + */ +public class DevHostApplication extends HostAdminApplication { + public DevHostApplication() { + super(InfrastructureApplication.DEV_HOST); + } +} diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java index 9215581a2b9..67d54091adc 100644 --- a/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/duper/DuperModelManager.java @@ -9,6 +9,8 @@ import com.yahoo.config.model.api.SuperModelListener; import com.yahoo.config.model.api.SuperModelProvider; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.HostName; +import com.yahoo.config.provision.SystemName; +import com.yahoo.vespa.flags.FlagSource; import com.yahoo.vespa.service.monitor.CriticalRegion; import com.yahoo.vespa.service.monitor.DuperModelInfraApi; import com.yahoo.vespa.service.monitor.DuperModelListener; @@ -43,6 +45,7 @@ public class DuperModelManager implements DuperModelProvider, DuperModelInfraApi static final ConfigServerApplication configServerApplication = new ConfigServerApplication(); static final ProxyHostApplication proxyHostApplication = new ProxyHostApplication(); static final TenantHostApplication tenantHostApplication = new TenantHostApplication(); + static final DevHostApplication devHostApplication = new DevHostApplication(); private final Map<ApplicationId, InfraApplication> supportedInfraApplications; @@ -58,18 +61,23 @@ public class DuperModelManager implements DuperModelProvider, DuperModelInfraApi private boolean infraApplicationsIsComplete = false; @Inject - public DuperModelManager(ConfigserverConfig configServerConfig, SuperModelProvider superModelProvider) { + public DuperModelManager(ConfigserverConfig configServerConfig, FlagSource flagSource, SuperModelProvider superModelProvider) { this(configServerConfig.multitenant(), configServerConfig.serverNodeType() == ConfigserverConfig.ServerNodeType.Enum.controller, - superModelProvider, new DuperModel()); + superModelProvider, new DuperModel(), flagSource, SystemName.from(configServerConfig.system())); } /** Non-private for testing */ public DuperModelManager(boolean multitenant, boolean isController, SuperModelProvider superModelProvider, - DuperModel duperModel) { + DuperModel duperModel, FlagSource flagSource, SystemName system) { this.duperModel = duperModel; - if (multitenant) { + if (system == SystemName.dev) { + // TODO (mortent): Support controllerApplication in dev system + supportedInfraApplications = + Stream.of(devHostApplication, configServerApplication) + .collect(Collectors.toUnmodifiableMap(InfraApplication::getApplicationId, Function.identity())); + } else if (multitenant) { supportedInfraApplications = (isController ? Stream.of(controllerHostApplication, controllerApplication) : diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java index a3af44ec911..8b0cc621358 100644 --- a/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java +++ b/service-monitor/src/test/java/com/yahoo/vespa/service/duper/DuperModelManagerTest.java @@ -33,12 +33,13 @@ public class DuperModelManagerTest { private final SuperModelProvider superModelProvider = mock(SuperModelProvider.class); private final SuperModel superModel = mock(SuperModel.class); private final DuperModel duperModel = mock(DuperModel.class); + private final InMemoryFlagSource flagSource = new InMemoryFlagSource(); private DuperModelManager manager; private SuperModelListener superModelListener; private void makeManager(boolean isController) { - manager = new DuperModelManager(true, isController, superModelProvider, duperModel); + manager = new DuperModelManager(true, isController, superModelProvider, duperModel, flagSource, SystemName.cd); when(superModelProvider.getSuperModel()).thenReturn(superModel); verify(duperModel, times(0)).add(any()); |