zrhoffman commented on code in PR #7795:
URL: https://github.com/apache/trafficcontrol/pull/7795#discussion_r1323266335
##########
infrastructure/cdn-in-a-box/enroller/enroller.go:
##########
@@ -318,10 +318,10 @@ func enrollDeliveryServiceServer(toSession *session, r
io.Reader) error {
if len(servers.Response) == 0 {
return errors.New("no server with hostName " + sn)
}
- if servers.Response[0].ID == nil {
- return fmt.Errorf("Traffic Ops gave back a
representation for server '%s' with null or undefined ID", sn)
+ if servers.Response[0].ID < 1 {
+ return fmt.Errorf("Traffic Ops gave back a
representation for server '%s' with non-positive ID", sn)
Review Comment:
> I think you should just get rid of this check instead of "fixing" it.
Removed in 6268f0aaf
##########
infrastructure/cdn-in-a-box/enroller/enroller.go:
##########
@@ -361,21 +361,21 @@ func enrollDivision(toSession *session, r io.Reader)
error {
func enrollOrigin(toSession *session, r io.Reader) error {
dec := json.NewDecoder(r)
- var s tc.Origin
+ var s tc.OriginV5
err := dec.Decode(&s)
if err != nil {
log.Infof("error decoding Origin: %v", err)
return err
}
- if s.Name == nil {
+ if s.Name == "" {
Review Comment:
> same as above, but with less gusto
Removed in 6268f0aaf
##########
infrastructure/cdn-in-a-box/enroller/enroller.go:
##########
@@ -827,7 +827,7 @@ func enrollFederation(toSession *session, r io.Reader)
error {
return err
}
deliveryService := deliveryServices.Response[0]
- if deliveryService.CDNName == nil || deliveryService.ID
== nil || deliveryService.XMLID == nil {
+ if deliveryService.CDNName == nil || deliveryService.ID
== nil || deliveryService.XMLID == "" {
Review Comment:
Removed in 6268f0aaf2
##########
infrastructure/cdn-in-a-box/enroller/Dockerfile:
##########
@@ -40,6 +40,7 @@ COPY ./go.mod ./go.sum
/go/src/github.com/apache/trafficcontrol/
COPY ./vendor/ /go/src/github.com/apache/trafficcontrol/vendor/
COPY ./traffic_ops/toclientlib/
/go/src/github.com/apache/trafficcontrol/traffic_ops/toclientlib/
COPY ./traffic_ops/v4-client/
/go/src/github.com/apache/trafficcontrol/traffic_ops/v4-client/
Review Comment:
> do we still need the v4 client for something?
Yes. `github.com/apache/trafficcontrol/lib/go-tc/totest`, the library used
for the t3c integration tests, uses API v4. Once #7774 is merged, it will use
API v5 instead and this line can be removed (or even in #7774 itself if #7795
gets merged first).
--
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]