use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class IndexingModeChangeValidator method validate.
@Override
public List<ConfigChangeAction> validate(VespaModel currentModel, VespaModel nextModel, ValidationOverrides overrides, Instant now) {
List<ConfigChangeAction> actions = new ArrayList<>();
for (Map.Entry<String, ContentCluster> currentEntry : currentModel.getContentClusters().entrySet()) {
ContentCluster nextCluster = nextModel.getContentClusters().get(currentEntry.getKey());
if (nextCluster == null)
continue;
Optional<ConfigChangeAction> change = validateContentCluster(currentEntry.getValue(), nextCluster, overrides, now);
if (change.isPresent())
actions.add(change.get());
}
return actions;
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class ContainerRestartValidatorTest method validator_returns_empty_list_for_containers_with_restart_on_deploy_disabled.
@Test
public void validator_returns_empty_list_for_containers_with_restart_on_deploy_disabled() {
VespaModel current = createModel(false);
VespaModel next = createModel(false);
List<ConfigChangeAction> result = validateModel(current, next);
assertTrue(result.isEmpty());
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class ContainerRestartValidatorTest method validator_returns_action_for_containers_with_restart_on_deploy_enabled.
@Test
public void validator_returns_action_for_containers_with_restart_on_deploy_enabled() {
VespaModel current = createModel(true);
VespaModel next = createModel(true);
List<ConfigChangeAction> result = validateModel(current, next);
assertEquals(2, result.size());
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class StartupCommandChangeValidatorTest method requireEmptyResultForEqualStartupCommand.
@Test
public void requireEmptyResultForEqualStartupCommand() {
MockRoot oldRoot = createRootWithChildren(new ServiceStub("evilservice", "./hax.sh"));
MockRoot newRoot = createRootWithChildren(new ServiceStub("evilservice", "./hax.sh"));
List<ConfigChangeAction> changes = getStartupCommandChanges(oldRoot, newRoot);
assertTrue(changes.isEmpty());
}
use of com.yahoo.config.model.api.ConfigChangeAction in project vespa by vespa-engine.
the class StartupCommandChangeValidatorTest method requireEmptyResultForDifferentServices.
@Test
public void requireEmptyResultForDifferentServices() {
MockRoot oldRoot = createRootWithChildren(new ServiceStub("evilservice", "./hax.sh"));
MockRoot newRoot = createRootWithChildren(new ServiceStub("goodservice", "./hax.sh"));
List<ConfigChangeAction> changes = getStartupCommandChanges(oldRoot, newRoot);
assertTrue(changes.isEmpty());
}
Aggregations