This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 222da3e  Fixed TO log warning when generating snapshots for 
topology-based delivery services (#5428)
222da3e is described below

commit 222da3e3dfda39f8ada310e1eb107168e5a43212
Author: rimashah25 <[email protected]>
AuthorDate: Tue Jan 12 15:21:34 2021 -0700

    Fixed TO log warning when generating snapshots for topology-based delivery 
services (#5428)
    
    * Fixed TO log warning.
    
    * Added condition for only topology based DS.
---
 CHANGELOG.md                                       | 1 +
 traffic_ops/traffic_ops_golang/crconfig/servers.go | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d2599e..93e52a0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/).
 - Traffic Ops: Added validation to ensure that the cachegroups of a delivery 
services' assigned ORG servers are present in the topology
 
 ### Fixed
+- [#5192](https://github.com/apache/trafficcontrol/issues/5192) - Fixed TO log 
warnings when generating snapshots for topology-based delivery services.
 - [#5284](https://github.com/apache/trafficcontrol/issues/5284) - Fixed error 
message when creating a server with non-existent profile
 - [#5287](https://github.com/apache/trafficcontrol/issues/5287) - Fixed error 
message when creating a Cache Group with no typeId
 - [#5382](https://github.com/apache/trafficcontrol/issues/5382) - Fixed API 
documentation and TP helptext for "Max DNS Answers" field with respect to DNS, 
HTTP, Steering Delivery Service
diff --git a/traffic_ops/traffic_ops_golang/crconfig/servers.go 
b/traffic_ops/traffic_ops_golang/crconfig/servers.go
index ac5951d..2d1112a 100644
--- a/traffic_ops/traffic_ops_golang/crconfig/servers.go
+++ b/traffic_ops/traffic_ops_golang/crconfig/servers.go
@@ -327,12 +327,12 @@ order by dsr.set_number asc
        hostReplacer := strings.NewReplacer(`\`, ``, `.*`, ``)
 
        dsInfs := map[string][]DSRouteInfo{}
+       var hasTopology bool
        for rows.Next() {
                ds := ""
                dsType := ""
                dsPattern := ""
                dsRoutingName := ""
-               var hasTopology bool
                inf := DSRouteInfo{}
                if err := rows.Scan(&ds, &dsType, &dsRoutingName, &dsPattern, 
&hasTopology); err != nil {
                        return nil, errors.New("Error scanning server 
deliveryservices: " + err.Error())
@@ -361,7 +361,9 @@ order by dsr.set_number asc
                for _, dsName := range dses {
                        dsInfList, ok := dsInfs[string(dsName)]
                        if !ok {
-                               log.Warnln("Creating CRConfig: deliveryservice 
" + string(dsName) + " has no regexes, skipping")
+                               if !hasTopology {
+                                       log.Warnln("Creating CRConfig: 
deliveryservice " + string(dsName) + " has no regexes, skipping")
+                               }
                                continue
                        }
                        for _, dsInf := range dsInfList {

Reply via email to