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



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

Review comment:
       fmt.println was supposed to be cleaned up. That is my mistake. And i'll 
add a better log line.

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

Review comment:
       ok.




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