ocket8888 commented on code in PR #7042:
URL: https://github.com/apache/trafficcontrol/pull/7042#discussion_r959826133
##########
traffic_ops/traffic_ops_golang/server/put_status.go:
##########
@@ -121,7 +121,7 @@ func UpdateStatusHandler(w http.ResponseWriter, r
*http.Request) {
return
}
- if *status.Name == tc.CacheStatusAdminDown.String() || *status.Name ==
tc.CacheStatusOffline.String() {
+ if *status.Name != tc.CacheStatusOnline.String() && *status.Name !=
tc.CacheStatusReported.String() {
Review Comment:
Server statuses should not be mutable. It's one of a million places where we
hijacked a concept to provide arbitrary informative tagging, which is better
provided by [actual tags](https://github.com/apache/trafficcontrol/pull/4819).
As it is, there's no guarantee that a status with any given name exists, or
that a status with any given ID won't be renamed arbitrarily at any moment.
Doing these kinds of checks becomes a lot easier once we can say what the
actual values are and should mean.
--
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]