summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java27
-rw-r--r--parent/pom.xml1
2 files changed, 19 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java
index 53f42866d8d..d28a0d69ab9 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/HostSystem.java
@@ -33,11 +33,18 @@ import static java.util.logging.Level.FINE;
public class HostSystem extends AbstractConfigProducer<Host> {
private static final Logger log = Logger.getLogger(HostSystem.class.getName());
+ private static final boolean doCheckIp;
+
private final Map<String, HostResource> hostname2host = new LinkedHashMap<>();
private final HostProvisioner provisioner;
private final DeployLogger deployLogger;
+ static {
+ String checkIpProperty = System.getProperty("config_model.ip_check", "true");
+ doCheckIp = ! checkIpProperty.equalsIgnoreCase("false");
+ }
+
public HostSystem(AbstractConfigProducer<?> parent, String name, HostProvisioner provisioner, DeployLogger deployLogger) {
super(parent, name);
this.provisioner = provisioner;
@@ -45,16 +52,18 @@ public class HostSystem extends AbstractConfigProducer<Host> {
}
void checkName(String hostname) {
- // Give a warning if the host does not exist
- try {
- var inetAddr = java.net.InetAddress.getByName(hostname);
- String canonical = inetAddr.getCanonicalHostName();
- if (! hostname.equals(canonical)) {
- deployLogger.logApplicationPackage(Level.WARNING, "Host named '" + hostname + "' may not receive any config " +
- "since it differs from its canonical hostname '" + canonical + "' (check DNS and /etc/hosts).");
+ if (doCheckIp) {
+ // Give a warning if the host does not exist
+ try {
+ var inetAddr = java.net.InetAddress.getByName(hostname);
+ String canonical = inetAddr.getCanonicalHostName();
+ if (!hostname.equals(canonical)) {
+ deployLogger.logApplicationPackage(Level.WARNING, "Host named '" + hostname + "' may not receive any config " +
+ "since it differs from its canonical hostname '" + canonical + "' (check DNS and /etc/hosts).");
+ }
+ } catch (UnknownHostException e) {
+ deployLogger.logApplicationPackage(Level.WARNING, "Unable to lookup IP address of host: " + hostname);
}
- } catch (UnknownHostException e) {
- deployLogger.logApplicationPackage(Level.WARNING, "Unable to lookup IP address of host: " + hostname);
}
}
diff --git a/parent/pom.xml b/parent/pom.xml
index 4c100397e9d..908491835ea 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -196,6 +196,7 @@
<configuration>
<redirectTestOutputToFile>${test.hide}</redirectTestOutputToFile>
<systemPropertyVariables>
+ <config_model.ip_check>false</config_model.ip_check>
<jdisc.logger.level>INFO</jdisc.logger.level>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
</systemPropertyVariables>