From 99a26aed8b383221216815d02dc204773b90ba05 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 8 Aug 2024 15:25:11 +0200 Subject: [PATCH] report multiple zonefile errors, don't stop after first violation (#85) Co-authored-by: Michael Hoennig Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/85 Reviewed-by: Marc Sandlus --- ...HsDomainDnsSetupHostingAssetValidator.java | 1 + ...ttpSetupHostingAssetValidatorUnitTest.java | 8 ++-- .../hs/migration/ImportHostingAssets.java | 46 +++++++++++-------- .../hosting/zonefiles/zonefiles-vm1068.json | 31 +++++-------- 4 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/main/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainDnsSetupHostingAssetValidator.java b/src/main/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainDnsSetupHostingAssetValidator.java index 4f9f393b..57ffc279 100644 --- a/src/main/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainDnsSetupHostingAssetValidator.java +++ b/src/main/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainDnsSetupHostingAssetValidator.java @@ -97,6 +97,7 @@ public class HsDomainDnsSetupHostingAssetValidator extends HostingAssetEntityVal String toZonefileString(final HsHostingAsset assetEntity) { // TODO.spec: we need to expand the templates (auto-...) in the same way as in Saltstack, with proper IP-numbers etc. + // TODO.impl: auto-AUTOCONFIG-RR auto-AUTODISCOVER-RR missing return """ $TTL {ttl} diff --git a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainHttpSetupHostingAssetValidatorUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainHttpSetupHostingAssetValidatorUnitTest.java index 2cce0d82..d15f81a5 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainHttpSetupHostingAssetValidatorUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/hosting/asset/validators/HsDomainHttpSetupHostingAssetValidatorUnitTest.java @@ -59,7 +59,7 @@ class HsDomainHttpSetupHostingAssetValidatorUnitTest { "{type=string, propertyName=passenger-nodejs, matchesRegEx=[^/.*], provided=[/usr/bin/node], defaultValue=/usr/bin/node}", "{type=string, propertyName=passenger-python, matchesRegEx=[^/.*], provided=[/usr/bin/python3], defaultValue=/usr/bin/python3}", "{type=string, propertyName=passenger-ruby, matchesRegEx=[^/.*], provided=[/usr/bin/ruby], defaultValue=/usr/bin/ruby}", - "{type=string[], propertyName=subdomains, elementsOf={type=string, propertyName=subdomains, matchesRegEx=[(?!-)[A-Za-z0-9-]{1,63}(?