srijeet0406 commented on code in PR #7720:
URL: https://github.com/apache/trafficcontrol/pull/7720#discussion_r1302052996
##########
traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go:
##########
@@ -170,7 +170,30 @@ func ReadDSSHandler(w http.ResponseWriter, r
*http.Request) {
if err == nil && results == nil {
w.WriteHeader(http.StatusNotModified)
}
- api.WriteRespRaw(w, r, results)
+ if inf.Version.GreaterThanOrEqualTo(&api.Version{
+ Major: 5,
+ Minor: 0,
+ }) {
+ var resultsV5 tc.DeliveryServiceServerResponseV5
+ resultsV5.Limit = results.Limit
+ resultsV5.Orderby = results.Orderby
+ resultsV5.Size = results.Size
+ resultsV5.Alerts = results.Alerts
+ resultsV5.Response = *upgrade(results.Response)
+ api.WriteRespRaw(w, r, resultsV5)
+ } else {
+ api.WriteRespRaw(w, r, results)
+ }
+}
+
+func upgrade(dsServers []tc.DeliveryServiceServer)
*[]tc.DeliveryServiceServerV5 {
Review Comment:
This is a private function, and we don't really put comments on those.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]