rimashah25 commented on a change in pull request #5350:
URL: https://github.com/apache/trafficcontrol/pull/5350#discussion_r543540014



##########
File path: traffic_ops/traffic_ops_golang/topology/topologies.go
##########
@@ -150,6 +150,19 @@ func (topology *TOTopology) Validate() error {
        rules["empty cachegroups"] = 
topology_validation.CheckForEmptyCacheGroups(topology.ReqInfo.Tx, 
cacheGroupIds, dsCDNs, false, nil)
        rules["required capabilities"] = 
topology.validateDSRequiredCapabilities()
 
+       for _, cdnId := range dsCDNs {
+               err, dsId := 
dbhelpers.GetDSByCDNIdTopology(topology.ReqInfo.Tx.Tx, cdnId, topology.Name)
+               if err != nil {
+                       return fmt.Errorf("failed to get a response from DB: 
%s", err)
+               }
+               //Get current Topology-CG for the requested change.
+               topoCachegroupNames := topology.getCachegroupNames()
+               userErr, sysErr, _ := 
dbhelpers.CheckTopologyOrgServerCGInDSCG(topology.ReqInfo.Tx.Tx, dsId, 
topology.Name, topoCachegroupNames)
+               if userErr != nil || sysErr != nil {
+                       return fmt.Errorf("%s", userErr.Error())

Review comment:
       Done.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to