summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2022-08-06 09:16:39 +0200
committerGitHub <noreply@github.com>2022-08-06 09:16:39 +0200
commit4b50e2dd9b56d08f3b6bf5a131c8b07c829d823f (patch)
tree78da9ae71e5c36339807400b188f4e1b125fee4f
parent866cc9b345768d238f1790b60e052a004e6740bc (diff)
parent71cd46f8c46adbb86bb837c154afa982e9ec2a29 (diff)
Merge pull request #23586 from vespa-engine/andreer/validate-all-xml-only-in-public
validate _all_ xml files only in public MERGEOK
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
index a90c3b958d7..63ba8197960 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionPreparer.java
@@ -279,19 +279,21 @@ public class SessionPreparer {
vespaPreprocess(applicationPackageDir.getAbsoluteFile(), hostsXml, applicationPackage.getMetaData());
}
- // Validate all other XML files
- try (var paths = Files.find(applicationPackageDir.getAbsoluteFile().toPath(), Integer.MAX_VALUE,
- (path, attr) -> attr.isRegularFile() && path.getFileName().toString().matches(".*\\.[Xx][Mm][Ll]"))) {
- paths.filter(p -> !(p.equals(servicesXml.getAbsoluteFile().toPath()) || p.equals(hostsXml.getAbsoluteFile().toPath())))
- .forEach(xmlPath -> {
- try {
- new ValidationProcessor().process(XML.getDocument(xmlPath.toFile()));
- } catch (IOException | TransformerException e) {
- throw new RuntimeException(e);
- }
- });
- } catch (IOException e) {
- throw new RuntimeException(e);
+ if (zone.system().isPublic()) {
+ // Validate all other XML files
+ try (var paths = Files.find(applicationPackageDir.getAbsoluteFile().toPath(), Integer.MAX_VALUE,
+ (path, attr) -> attr.isRegularFile() && path.getFileName().toString().matches(".*\\.[Xx][Mm][Ll]"))) {
+ paths.filter(p -> !(p.equals(servicesXml.getAbsoluteFile().toPath()) || p.equals(hostsXml.getAbsoluteFile().toPath())))
+ .forEach(xmlPath -> {
+ try {
+ new ValidationProcessor().process(XML.getDocument(xmlPath.toFile()));
+ } catch (IOException | TransformerException e) {
+ throw new RuntimeException(e);
+ }
+ });
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
}
// Validate pom.xml files in OSGi bundles