zrhoffman commented on code in PR #7774:
URL: https://github.com/apache/trafficcontrol/pull/7774#discussion_r1325094414


##########
lib/go-atscfg/servercachedotconfig.go:
##########
@@ -39,7 +39,7 @@ func makeCacheDotConfigMid(
        }
        warnings := []string{}
 
-       if server.HostName == nil {
+       if &server.HostName == nil || server.HostName == "" {

Review Comment:
   `nil` check can be removed



##########
cache-config/testing/ort-tests/tcdata/servers.go:
##########
@@ -19,18 +19,18 @@ import (
        "fmt"
 
        "github.com/apache/trafficcontrol/cache-config/t3cutil/toreq"
-       toclient "github.com/apache/trafficcontrol/traffic_ops/v4-client"
+       toclient "github.com/apache/trafficcontrol/traffic_ops/v5-client"
 )
 
 func (r *TCData) QueueUpdatesForServer(hostname string, queue bool) error {
        respServer, _, err := toreq.GetServerByHostName(TOSession, hostname)
        if err != nil {
                return fmt.Errorf("cannot GET Server by hostname '%s': %v", 
hostname, err)
        }
-       if respServer.ID == nil {
+       if &respServer.ID == nil || respServer.ID == 0 {

Review Comment:
   `nil` check can be removed



##########
cache-config/t3cutil/getdatacfg.go:
##########
@@ -550,11 +550,11 @@ func GetConfigData(toClient *toreq.TOClient, disableProxy 
bool, cacheHostName st
                        defer func(start time.Time) { log.Infof("jobsF took 
%v\n", time.Since(start)) }(time.Now())
                        {
                                reqHdr := (http.Header)(nil)
-                               if oldCfg != nil && oldServer.CDNName != nil && 
*oldServer.CDNName == *server.CDNName {
+                               if oldCfg != nil && oldServer.CDN != "nil" && 
oldServer.CDN == server.CDN {

Review Comment:
   `"nil"` check can be removed



##########
cache-config/t3cutil/getdatacfg.go:
##########
@@ -248,7 +248,7 @@ func GetConfigData(toClient *toreq.TOClient, disableProxy 
bool, cacheHostName st
        oldServer := &atscfg.Server{}
        if oldCfg != nil {
                for _, toServer := range oldCfg.Servers {
-                       if toServer.HostName != nil && *toServer.HostName == 
oldCfg.MetaData.CacheHostName {
+                       if toServer.HostName != "nil" && toServer.HostName == 
oldCfg.MetaData.CacheHostName {

Review Comment:
   `"nil"` check can be removed



##########
lib/go-atscfg/bgfetchdotconfig.go:
##########
@@ -39,7 +39,7 @@ func MakeBGFetchDotConfig(
        }
        warnings := []string{}
 
-       if server.CDNName == nil {
+       if &server.CDN == nil || server.CDN == "" {

Review Comment:
   `nil` check can be removed



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

Reply via email to