rawlinp commented on a change in pull request #2979: Fix TO Go DSS GET 
endpoints to check tenancy
URL: https://github.com/apache/trafficcontrol/pull/2979#discussion_r254044852
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
 ##########
 @@ -142,7 +143,21 @@ func (dss *TODeliveryServiceServer) readDSS(tx *sqlx.Tx, 
user *auth.CurrentUser,
                orderby = "deliveryService"
        }
 
-       query, err := selectQuery(orderby, strconv.Itoa(limit), 
strconv.Itoa(offset))
+       tenancyEnabled, err := tenant.IsTenancyEnabledTx(tx.Tx)
 
 Review comment:
   It can be "turned off" by setting the parameter to false or deleting the 
parameter, but it is not really "turned off" at that point because we already 
have various places in the code that assume tenancy is always enabled (so they 
don't check the parameter). So "turning it off" doesn't completely turn it off, 
which is why we should really be preventing the deletion/update of the 
`use_tenancy` parameter to "turn off tenancy", since that really just leaves 
the system in an inconsistent state. Some things will check the tenancy 
parameter, whereas others already assume tenancy is always enabled.
   
   We attempted to delete the `use_tenancy` parameter from the system but 
realized that there is too much existing code that depends on that parameter 
being there. The plan was to "fix" the existing code that checks the parameter 
by removing the parameter check and just assume that tenancy is always enabled. 
This was all discussed on the mailing list already; the decision to have it 
always enabled has already been made. Steps have already been made to enable it 
by default, but the existing code that checks the `use_tenancy` parameter has 
not been cleaned up yet.
   
   tldr; tenancy should always be considered enabled, and existing code that 
checks the `use_tenancy` parameter needs to be fixed. Once all existing tenancy 
checks have been "fixed", the parameter can be deleted.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to