ocket8888 commented on a change in pull request #6675:
URL: https://github.com/apache/trafficcontrol/pull/6675#discussion_r830241926
##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
##########
@@ -957,9 +957,12 @@ func (dss *TODSSDeliveryService) Read(h http.Header,
useIMS bool) ([]interface{}
if version.Major > 3 && version.Minor >= 0 {
ds = ds.RemoveLD1AndLD2()
returnable = append(returnable, ds)
- } else {
+ } else if version.Major > 2 {
dsV3 := ds.DowngradeToV3()
returnable = append(returnable, dsV3)
Review comment:
this will return APIv3.1 structures in calls to v3.0 - gotta check the
minor version
##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -846,7 +846,29 @@ func (ds *DeliveryServiceV4) RemoveLD1AndLD2()
DeliveryServiceV4 {
return *ds
}
-// DowngradeToV3 converts the 4.x DS to a 3.x DS.
+// DowngradeToV2 converts a 4.x DS to a 2.x DS.
+func (ds *DeliveryServiceV4) DowngradeToV2() DeliveryServiceNullable {
Review comment:
You don't need to write this whole method, I think, the v2 DS can be
accessed directly through
`DeliveryServiceNullableV30.DeliveryServiceNullableV15`. That's what the
`/deliveryservices` handler does.
--
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]