use of com.yahoo.config.model.deploy.DeployState in project vespa by vespa-engine.
the class AccessLogBuilder method buildIfNotDisabled.
public static Optional<AccessLogComponent> buildIfNotDisabled(ContainerCluster cluster, Element accessLogSpec) {
AccessLogTypeLiteral typeLiteral = getOptionalAttribute(accessLogSpec, "type").map(AccessLogTypeLiteral::fromAttributeValue).orElse(AccessLogTypeLiteral.VESPA);
AccessLogType logType = logTypeFor(typeLiteral);
if (logType == null) {
return Optional.empty();
}
DeployState deployState = cluster.getDeployState();
return Optional.of(new DomBuilder(logType, deployState).build(cluster, accessLogSpec));
}
use of com.yahoo.config.model.deploy.DeployState in project vespa by vespa-engine.
the class RoutingBuilderTest method getContainer.
private Container getContainer(ApplicationPackage applicationPackage, String region, Element clusterElem) throws IOException, SAXException {
DeployState deployState = new DeployState.Builder().applicationPackage(applicationPackage).zone(new Zone(Environment.prod, RegionName.from(region))).build(true);
root = new MockRoot("root", deployState);
createModel(root, deployState, clusterElem);
ContainerCluster cluster = getContainerCluster("default");
return cluster.getContainers().get(0);
}
use of com.yahoo.config.model.deploy.DeployState in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_with_no_handlers_passes_validation_without_write_protection.
@Test
public void cluster_with_no_handlers_passes_validation_without_write_protection() throws IOException, SAXException {
DeployState deployState = deployState(servicesXml(false, false));
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.deploy.DeployState in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_with_write_protection_passes_validation.
@Test
public void cluster_with_write_protection_passes_validation() throws IOException, SAXException {
DeployState deployState = deployState(servicesXml(true, true));
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
use of com.yahoo.config.model.deploy.DeployState in project vespa by vespa-engine.
the class AccessControlValidatorTest method cluster_without_custom_components_passes_validation_without_write_protection.
@Test
public void cluster_without_custom_components_passes_validation_without_write_protection() throws IOException, SAXException {
String servicesXml = joinLines("<services version='1.0'>", " <container id='default' version='1.0' />", "</services>");
DeployState deployState = deployState(servicesXml);
VespaModel model = new VespaModel(new NullConfigModelRegistry(), deployState);
new AccessControlValidator().validate(model, deployState);
}
Aggregations