You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by zr...@apache.org on 2022/05/19 20:37:47 UTC
[trafficcontrol] branch master updated: Fix t3c strategy peer yaml typo (#6835)
This is an automated email from the ASF dual-hosted git repository.
zrhoffman 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 2022f59ec9 Fix t3c strategy peer yaml typo (#6835)
2022f59ec9 is described below
commit 2022f59ec92e16795a4006bb702237f46add8c1e
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Thu May 19 14:37:43 2022 -0600
Fix t3c strategy peer yaml typo (#6835)
---
lib/go-atscfg/strategiesdotconfig.go | 2 +-
lib/go-atscfg/strategiesdotconfig_test.go | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/go-atscfg/strategiesdotconfig.go b/lib/go-atscfg/strategiesdotconfig.go
index bd529a03c2..0b2d46168c 100644
--- a/lib/go-atscfg/strategiesdotconfig.go
+++ b/lib/go-atscfg/strategiesdotconfig.go
@@ -252,7 +252,7 @@ func getStrategyGroupsSection(pa *ParentAbstraction) string {
if len(pa.Peers) != 0 {
txt += "\n" + ` - &peers_group`
for i, peer := range pa.Peers {
- txt += "\n" + ` - << *peer` + strconv.Itoa(i+1)
+ txt += "\n" + ` - <<: *peer` + strconv.Itoa(i+1)
txt += "\n" + ` weight: ` + strconv.FormatFloat(peer.Weight, 'f', 3, 64)
}
}
diff --git a/lib/go-atscfg/strategiesdotconfig_test.go b/lib/go-atscfg/strategiesdotconfig_test.go
index d39c480dea..073fa4f904 100644
--- a/lib/go-atscfg/strategiesdotconfig_test.go
+++ b/lib/go-atscfg/strategiesdotconfig_test.go
@@ -445,4 +445,9 @@ func TestMakeStrategiesHTTPSOrigin(t *testing.T) {
if strings.Contains(txt, "port: 443") {
t.Errorf("expected edge parent.config of https origin to use internal http port 80 and not https/443, actual: '%v'", txt)
}
+
+ // checks for properly-formed merge keys
+ if strings.Contains(cfg.Text, "<< ") {
+ t.Errorf("expected yaml merge keys to be '<<: ', actual malformed '<< ': %v", cfg.Text)
+ }
}