You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/11/18 19:06:16 UTC
[GitHub] [trafficcontrol] ocket8888 commented on a diff in pull request #7205: TR: use hostname from CRConfig if only a single TR in CRConfig
ocket8888 commented on code in PR #7205:
URL: https://github.com/apache/trafficcontrol/pull/7205#discussion_r1026787434
##########
traffic_router/core/src/main/java/org/apache/traffic_control/traffic_router/core/dns/ZoneManager.java:
##########
@@ -453,6 +454,17 @@ private static List<Record> fillZones(final Map<String, List<Record>> zoneMap, f
return records;
}
+ protected static String getTRLocalHostname(final TrafficRouter tr) throws UnknownHostException {
+ // if there is only one TR in the CRConfig, just use that TR's hostname
+ // instead of checking for the local server's hostname
+ final boolean singleTR = Iterators.size(tr.getCacheRegister().getTrafficRouters().fieldNames()) == 1;
Review Comment:
> would not be `null` or explicitly `undefined`
`undefined` is not a value in JSON, that's just JS. You'll never see anything "explicitly `undefined`" because that's not syntactically valid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org