rob05c commented on a change in pull request #5247:
URL: https://github.com/apache/trafficcontrol/pull/5247#discussion_r525511660
##########
File path: lib/go-atscfg/cachedotconfig.go
##########
@@ -23,33 +23,106 @@ import (
"sort"
"strings"
- "github.com/apache/trafficcontrol/lib/go-log"
"github.com/apache/trafficcontrol/lib/go-tc"
)
const ContentTypeCacheDotConfig = ContentTypeTextASCII
const LineCommentCacheDotConfig = LineCommentHash
-type ProfileDS struct {
- Type tc.DSType
- OriginFQDN *string
+func MakeCacheDotConfig(
+ server *Server,
+ servers []Server,
+ deliveryServices []DeliveryService,
+ deliveryServiceServers []tc.DeliveryServiceServer,
+ hdrComment string,
+) (Cfg, error) {
+ if tc.CacheTypeFromString(server.Type) == tc.CacheTypeMid {
+ return makeCacheDotConfigMid(server, deliveryServices,
hdrComment)
+ } else {
+ return makeCacheDotConfigEdge(server, servers,
deliveryServices, deliveryServiceServers, hdrComment)
+ }
}
// MakeCacheDotConfig makes the ATS cache.config config file.
// profileDSes must be the list of delivery services, which are assigned to
severs, for which this profile is assigned. It MUST NOT contain any other
delivery services. Note DSesToProfileDSes may be helpful if you have a
[]tc.DeliveryServiceNullable, for example from traffic_ops/client.
Review comment:
Yep. Fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]