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 85bfc75042 Add t3c remap.config ds comment (#6893)
85bfc75042 is described below
commit 85bfc750421eab5cf9d6df41f2f84062a8a40e3f
Author: Robert O Butts <[email protected]>
AuthorDate: Fri Jun 10 08:10:30 2022 -0600
Add t3c remap.config ds comment (#6893)
Adds a comment to the remap.config generation of the delivery service
name.
This is designed to help debugging production issues. Without this,
there's no indicator which DS a remap line came from, and the
only way to know is to look for a DS that has the FQDN.
---
cache-config/testing/ort-tests/baseline-configs/remap.config | 4 ++--
lib/go-atscfg/remapdotconfig.go | 5 +++--
lib/go-atscfg/remapdotconfig_test.go | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/cache-config/testing/ort-tests/baseline-configs/remap.config
b/cache-config/testing/ort-tests/baseline-configs/remap.config
index 238313c0c0..5971934bce 100644
--- a/cache-config/testing/ort-tests/baseline-configs/remap.config
+++ b/cache-config/testing/ort-tests/baseline-configs/remap.config
@@ -1,3 +1,3 @@
# DO NOT EDIT - Generated for atlanta-edge-03 by () on Fri Nov 13 18:49:10
UTC 2020
-map http://atlanta-edge-03.ds-top.test.cdn1.net/
http://origin.topology.example.net/ @plugin=header_rewrite.so
@pparam=dscp/set_dscp_40.config @plugin=header_rewrite.so
@pparam=hdr_rw_first_ds-top.config @plugin=cachekey.so @pparam=--separator=
@pparam=--remove-all-params=true @pparam=--remove-path=true
@pparam=--capture-prefix-uri=/^([^?]*)/$1/ # topology 'mso-topology'
-map https://atlanta-edge-03.ds-top.test.cdn1.net/
http://origin.topology.example.net/ @plugin=header_rewrite.so
@pparam=dscp/set_dscp_40.config @plugin=header_rewrite.so
@pparam=hdr_rw_first_ds-top.config @plugin=cachekey.so @pparam=--separator=
@pparam=--remove-all-params=true @pparam=--remove-path=true
@pparam=--capture-prefix-uri=/^([^?]*)/$1/ # topology 'mso-topology'
\ No newline at end of file
+map http://atlanta-edge-03.ds-top.test.cdn1.net/
http://origin.topology.example.net/ @plugin=header_rewrite.so
@pparam=dscp/set_dscp_40.config @plugin=header_rewrite.so
@pparam=hdr_rw_first_ds-top.config @plugin=cachekey.so @pparam=--separator=
@pparam=--remove-all-params=true @pparam=--remove-path=true
@pparam=--capture-prefix-uri=/^([^?]*)/$1/ # ds 'ds-top' topology 'mso-topology'
+map https://atlanta-edge-03.ds-top.test.cdn1.net/
http://origin.topology.example.net/ @plugin=header_rewrite.so
@pparam=dscp/set_dscp_40.config @plugin=header_rewrite.so
@pparam=hdr_rw_first_ds-top.config @plugin=cachekey.so @pparam=--separator=
@pparam=--remove-all-params=true @pparam=--remove-path=true
@pparam=--capture-prefix-uri=/^([^?]*)/$1/ # ds 'ds-top' topology 'mso-topology'
diff --git a/lib/go-atscfg/remapdotconfig.go b/lib/go-atscfg/remapdotconfig.go
index a5037df96a..b0201ea687 100644
--- a/lib/go-atscfg/remapdotconfig.go
+++ b/lib/go-atscfg/remapdotconfig.go
@@ -462,10 +462,11 @@ func getServerConfigRemapDotConfigForEdge(
if err != nil {
return "", warnings, err
}
+ remapText += ` # ds '` + *ds.XMLID + `'
topology '`
if hasTopology {
- remapText += " # topology '" +
topology.Name + "'"
+ remapText += topology.Name
}
- remapText += "\n"
+ remapText += `'` + "\n"
}
}
diff --git a/lib/go-atscfg/remapdotconfig_test.go
b/lib/go-atscfg/remapdotconfig_test.go
index c039a5fa3a..fb8efcb42e 100644
--- a/lib/go-atscfg/remapdotconfig_test.go
+++ b/lib/go-atscfg/remapdotconfig_test.go
@@ -5858,7 +5858,7 @@ func
TestMakeRemapDotConfigRawRemapWithoutRangeDirective(t *testing.T) {
t.Errorf("expected remap on edge server with ds slice range
request handling to contain block size for the slice plugin, actual '%v'", txt)
}
- if !strings.HasSuffix(remapLine, "@plugin=tslua.so
@pparam=my-range-manipulator.lua") {
+ if !strings.HasSuffix(remapLine, "@plugin=tslua.so
@pparam=my-range-manipulator.lua # ds 'mydsname' topology ''") {
t.Errorf("expected raw remap without range directive at end of
remap line, actual '%v'", txt)
}
if strings.Count(remapLine, "slice.so") != 1 {