You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2020/01/10 21:27:47 UTC

[trafficcontrol] branch 4.0.x updated: Fix atstccfg logging non-errors (#4280) (#4283)

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

rawlin pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/4.0.x by this push:
     new 4e8c643  Fix atstccfg logging non-errors (#4280) (#4283)
4e8c643 is described below

commit 4e8c643504379062b009963e7e6c5b2d4b3f9790
Author: Robert Butts <ro...@users.noreply.github.com>
AuthorDate: Fri Jan 10 14:27:40 2020 -0700

    Fix atstccfg logging non-errors (#4280) (#4283)
    
    (cherry picked from commit 4a91ed9b18cebcef05d79a6c05b2663e29c11a67)
---
 traffic_ops/ort/atstccfg/cfgfile/cacheurldotconfig.go     |  7 ++++---
 traffic_ops/ort/atstccfg/cfgfile/sslmulticertdotconfig.go | 12 +++++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/traffic_ops/ort/atstccfg/cfgfile/cacheurldotconfig.go b/traffic_ops/ort/atstccfg/cfgfile/cacheurldotconfig.go
index a0da83d..db96037 100644
--- a/traffic_ops/ort/atstccfg/cfgfile/cacheurldotconfig.go
+++ b/traffic_ops/ort/atstccfg/cfgfile/cacheurldotconfig.go
@@ -23,7 +23,6 @@ import (
 	"errors"
 
 	"github.com/apache/trafficcontrol/lib/go-atscfg"
-	"github.com/apache/trafficcontrol/lib/go-log"
 	"github.com/apache/trafficcontrol/lib/go-tc"
 	"github.com/apache/trafficcontrol/traffic_ops/ort/atstccfg/config"
 	"github.com/apache/trafficcontrol/traffic_ops/ort/atstccfg/toreq"
@@ -62,8 +61,6 @@ func GetConfigFileCDNCacheURL(cfg config.TCCfg, cdnNameOrID string, fileName str
 		return "", errors.New("getting delivery service servers: " + err.Error())
 	}
 
-	log.Errorf("gcfccu dss: %v\n", len(dss))
-
 	dssMap := map[int][]int{} // map[dsID]serverID
 	for _, dss := range dss {
 		if dss.Server == nil || dss.DeliveryService == nil {
@@ -77,6 +74,10 @@ func GetConfigFileCDNCacheURL(cfg config.TCCfg, cdnNameOrID string, fileName str
 		if ds.ID == nil {
 			continue // TODO warn
 		}
+		// ANY_MAP and STEERING DSes don't have origins, and thus can't be put into the cacheurl config.
+		if ds.Type != nil && (*ds.Type == tc.DSTypeAnyMap || *ds.Type == tc.DSTypeSteering) {
+			continue
+		}
 		if len(dssMap[*ds.ID]) == 0 {
 			continue
 		}
diff --git a/traffic_ops/ort/atstccfg/cfgfile/sslmulticertdotconfig.go b/traffic_ops/ort/atstccfg/cfgfile/sslmulticertdotconfig.go
index 928a558..e27205c 100644
--- a/traffic_ops/ort/atstccfg/cfgfile/sslmulticertdotconfig.go
+++ b/traffic_ops/ort/atstccfg/cfgfile/sslmulticertdotconfig.go
@@ -23,6 +23,7 @@ import (
 	"errors"
 
 	"github.com/apache/trafficcontrol/lib/go-atscfg"
+	"github.com/apache/trafficcontrol/lib/go-tc"
 	"github.com/apache/trafficcontrol/traffic_ops/ort/atstccfg/config"
 	"github.com/apache/trafficcontrol/traffic_ops/ort/atstccfg/toreq"
 )
@@ -48,7 +49,16 @@ func GetConfigFileCDNSSLMultiCertDotConfig(cfg config.TCCfg, cdnNameOrID string)
 		return "", errors.New("getting delivery services: " + err.Error())
 	}
 
-	cfgDSes := atscfg.DeliveryServicesToSSLMultiCertDSes(dses)
+	filteredDSes := []tc.DeliveryServiceNullable{}
+	for _, ds := range dses {
+		// ANY_MAP and STEERING DSes don't have origins, and thus can't be put into the ssl config.
+		if ds.Type != nil && (*ds.Type == tc.DSTypeAnyMap || *ds.Type == tc.DSTypeSteering) {
+			continue
+		}
+		filteredDSes = append(filteredDSes, ds)
+	}
+
+	cfgDSes := atscfg.DeliveryServicesToSSLMultiCertDSes(filteredDSes)
 
 	txt := atscfg.MakeSSLMultiCertDotConfig(cdnName, toToolName, toURL, cfgDSes)
 	return txt, nil