Deprecate aliases
@@ -360,18 +360,13 @@ public class ContainerModelBuilder extends ConfigModelBuilder<ContainerModel> {
if (environment != Environment.prod) return;
Element aliases = XML.getChild(spec, "aliases");
- List<Element> serviceAliasChildren = XML.getChildren(aliases, "service-alias");
- if (!serviceAliasChildren.isEmpty()) {
- log.logApplicationPackage(WARNING, "The 'service-alias' element has no effect and is deprecated for removal in Vespa 8");
+ if (aliases != null) {
+ log.logApplicationPackage(WARNING, "The 'aliases' element and its children has no effect. They have been deprecated for removal in Vespa 8");
}
- for (Element alias : serviceAliasChildren) {
+ for (Element alias : XML.getChildren(aliases, "service-alias")) {
cluster.serviceAliases().add(XML.getValue(alias));
}
- List<Element> endpointAliasChildren = XML.getChildren(aliases, "endpoint-alias");
- if (!endpointAliasChildren.isEmpty()) {
- log.logApplicationPackage(WARNING, "The 'endpoint-alias' element has no effect and is deprecated for removal in Vespa 8");
- }
- for (Element alias : endpointAliasChildren) {
+ for (Element alias : XML.getChildren(aliases, "endpoint-alias")) {
cluster.endpointAliases().add(XML.getValue(alias));
}
}
