rob05c commented on a change in pull request #6529:
URL: https://github.com/apache/trafficcontrol/pull/6529#discussion_r796155908
##########
File path: lib/go-atscfg/remapdotconfig.go
##########
@@ -289,16 +313,39 @@ func getServerConfigRemapDotConfigForMid(
if midRemap != "" {
midRemaps[remapFrom] = *ds.OrgServerFQDN + midRemap
}
+
+ // Any raw pre or post pend
+ dsPreRemaps, dsPostRemaps :=
lastPrePostRemapLinesFor(dsConfigParamsMap, *ds.XMLID)
+
+ // Add to pre/post remap lines if this is last tier
+ if 0 < len(dsPreRemaps) || 0 < len(dsPostRemaps) {
+ isLastCache, err := serverIsLastCacheForDS(server, &ds,
nameTopologies, cacheGroups)
+ if err != nil {
+ warnings = append(warnings, "ds '"+*ds.XMLID+"'
errors determining last tier "+err.Error())
Review comment:
Looking at the code, it looks like the only way that function can fail,
is if the data from TO is fundamentally broken.
It's things like
(1) The Server JSON has no CacheGroup
(2) A Topology entry references an index that doesn't exist
(3) A Topology references a CacheGroup name that doesn't exist.
It's all fundamentally-broken-data kind of stuff. I vote fail the config
gen, return an error.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]