You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2022/11/14 18:47:06 UTC
[GitHub] [trafficcontrol] jpappa200 opened a new pull request, #7192: update health-client to v4 API
jpappa200 opened a new pull request, #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192
<!--
Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
If this closes or relates to an existing issue, please reference it using one of the following:
Closes: #ISSUE
Related: #ISSUE
If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
-->
Closes: #7191
Updates to use traffic ops api v4. Also adds reload capability to systemd
<!-- **^ Add meaningful description above** --><hr/>
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this PR.
Feel free to add the name of a tool or script that is affected but not on the list.
-->
- Traffic Control Health Client (tc-health-client)
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your PR.
If your PR has tests (and most should), provide the steps needed to run the tests.
If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
Build health client and install on admin_down cache. change config file and run systemctl reload tc-health-client and monitor log messages
## If this is a bugfix, which Traffic Control versions contained the bug?
<!-- Delete this section if the PR is not a bugfix, or if the bug is only in the master branch.
Examples:
- 5.1.2
- 5.1.3 (RC1)
-->
Not a bug fix
## PR submission checklist
<!-- If not, please delete this text and explain why this PR does not need tests. -->
- [x] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
- [x] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] jpappa200 commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
jpappa200 commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1022031760
##########
tc-health-client/tmagent/tmagent.go:
##########
@@ -656,7 +656,9 @@ func (pi *ParentInfo) GetTOData(cfg *config.Cfg) error {
if *sv.CDNName != cfg.CDNName {
continue
}
- if sv.Type == tc.MonitorTypeName && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
+ // added OR because MonitorTypeName has been updated to 'TRAFFIC_MONITOR' and TO still has then listed as 'RASCAL'
+ // this will allow it to work either way and can be removed once TO is updated.
+ if (sv.Type == tc.MonitorTypeName || sv.Type == "RASCAL") && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
Review Comment:
Only compared against shared constant.
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1022032181
##########
tc-health-client/tmagent/tmagent.go:
##########
@@ -656,7 +656,9 @@ func (pi *ParentInfo) GetTOData(cfg *config.Cfg) error {
if *sv.CDNName != cfg.CDNName {
continue
}
- if sv.Type == tc.MonitorTypeName && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
+ // added OR because MonitorTypeName has been updated to 'TRAFFIC_MONITOR' and TO still has then listed as 'RASCAL'
+ // this will allow it to work either way and can be removed once TO is updated.
+ if (sv.Type == tc.MonitorTypeName || sv.Type == "RASCAL") && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
Review Comment:
I just read the comment (and noticed the rest of the code line, which includes `tc.MonitorTypeName` anyway).
[this will allow it to work either way and can be removed once TO is updated.](https://github.com/apache/trafficcontrol/blob/1c26082ebff759f4311845caee0d5cc1e0a4baa4/tc-health-client/tmagent/tmagent.go#L660)
I agree that checking for both `"TRAFFIC_MONITIOR"` and `"RASCAL"` is useful here, but I still think only shared constants should be used. How about making a new constant for "`RASCAL"`? Not sure how to version it, but there's def value in keeping the old one around to help with upgrades
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1024587976
##########
tc-health-client/tmagent/tmagent.go:
##########
@@ -656,7 +656,7 @@ func (pi *ParentInfo) GetTOData(cfg *config.Cfg) error {
if *sv.CDNName != cfg.CDNName {
continue
}
- if sv.Type == tc.MonitorTypeName && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
+ if (sv.Type == tc.MonitorTypeName || sv.Type == tc.RascalTypeName) && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
Review Comment:
`|| sv.Type == tc.RascalTypeName` is not needed, since #7190 revert renaming `RASCAL` to `TRAFFIC_MONITOR`.
##########
lib/go-tc/enum.go:
##########
@@ -143,6 +143,15 @@ const MonitorTypeName = "TRAFFIC_MONITOR"
// properly, and new code should not check this.
const MonitorProfilePrefix = "TRAFFIC_MONITOR"
+// RascalTypeName is the Name of the Type which must be assigned to a server
+// for it to be treated as a Traffic Monitor instance by ATC.
+//
+// "Rascal" is a legacy name for Traffic Monitor.
+//
+// Note that there is, in general, no guarantee that a Type with this name
+// exists in Traffic Ops at any given time.
+const RascalTypeName = "RASCAL"
+
Review Comment:
Since #7190 revert renaming `RASCAL` to `TRAFFIC_MONITOR`, this part is not needed.
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] jpappa200 commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
jpappa200 commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1021985725
##########
CHANGELOG.md:
##########
@@ -23,6 +23,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7176](https://github.com/apache/trafficcontrol/pull/7176) *ATC Build system* Support building ATC for the `aarch64` CPU architecture
### Changed
+- [#7191](https://github.com/apache/trafficcontrol/issues/7191) *tc-health-client* Uses Traffic Ops API 4.0. Also added reload option to systemd service file
+- [#2564](https://github.com/apache/trafficcontrol/issues/2564) Renamed RASCAL references to TRAFFIC_MONITOR
Review Comment:
I did a poor job of resolving the conflict. let me see if I can fix it
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] jpappa200 commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
jpappa200 commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1025268669
##########
lib/go-tc/enum.go:
##########
@@ -143,6 +143,15 @@ const MonitorTypeName = "TRAFFIC_MONITOR"
// properly, and new code should not check this.
const MonitorProfilePrefix = "TRAFFIC_MONITOR"
+// RascalTypeName is the Name of the Type which must be assigned to a server
+// for it to be treated as a Traffic Monitor instance by ATC.
+//
+// "Rascal" is a legacy name for Traffic Monitor.
+//
+// Note that there is, in general, no guarantee that a Type with this name
+// exists in Traffic Ops at any given time.
+const RascalTypeName = "RASCAL"
+
Review Comment:
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1022032181
##########
tc-health-client/tmagent/tmagent.go:
##########
@@ -656,7 +656,9 @@ func (pi *ParentInfo) GetTOData(cfg *config.Cfg) error {
if *sv.CDNName != cfg.CDNName {
continue
}
- if sv.Type == tc.MonitorTypeName && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
+ // added OR because MonitorTypeName has been updated to 'TRAFFIC_MONITOR' and TO still has then listed as 'RASCAL'
+ // this will allow it to work either way and can be removed once TO is updated.
+ if (sv.Type == tc.MonitorTypeName || sv.Type == "RASCAL") && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
Review Comment:
I just read the comment (and noticed the rest of the code line, which includes `tc.MonitorTypeName` anyway).
https://github.com/apache/trafficcontrol/blob/1c26082ebff759f4311845caee0d5cc1e0a4baa4/tc-health-client/tmagent/tmagent.go#L660
I agree that checking for both `"TRAFFIC_MONITIOR"` and `"RASCAL"` is useful here, but I still think only shared constants should be used. How about making a new constant for "`RASCAL"`? Not sure how to version it, but there's def value in keeping the old one around to help with upgrades
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman merged pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman merged PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on a diff in pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on code in PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#discussion_r1021969022
##########
tc-health-client/tmagent/tmagent.go:
##########
@@ -656,7 +656,9 @@ func (pi *ParentInfo) GetTOData(cfg *config.Cfg) error {
if *sv.CDNName != cfg.CDNName {
continue
}
- if sv.Type == tc.MonitorTypeName && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
+ // added OR because MonitorTypeName has been updated to 'TRAFFIC_MONITOR' and TO still has then listed as 'RASCAL'
+ // this will allow it to work either way and can be removed once TO is updated.
+ if (sv.Type == tc.MonitorTypeName || sv.Type == "RASCAL") && tc.CacheStatus(*sv.Status) == tc.CacheStatusOnline {
Review Comment:
The `sv.Type` comparison should be against a shared constant like `tc.MonitorTypeName` rather than the string literal `"RASCAL"`.
https://github.com/apache/trafficcontrol/blob/1c26082ebff759f4311845caee0d5cc1e0a4baa4/lib/go-tc/enum.go#L134-L136
- It's unfortunate that `tc.MonitorTypeName`'s documentation appears to discourages its use. It was added in #6040, and if I had noticed it at the time, I would have suggested rewording it before merging #6040. I think what it's trying to say is that its value could potentially be updated to something else in a future PR, but @ocket8888 can tell us for sure what he was trying to say.
- `tc.MonitorTypeName` changed from `"RASCAL"` to `"TRAFFIC_MONITIOR"` in #7068
##########
CHANGELOG.md:
##########
@@ -23,6 +23,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#7176](https://github.com/apache/trafficcontrol/pull/7176) *ATC Build system* Support building ATC for the `aarch64` CPU architecture
### Changed
+- [#7191](https://github.com/apache/trafficcontrol/issues/7191) *tc-health-client* Uses Traffic Ops API 4.0. Also added reload option to systemd service file
+- [#2564](https://github.com/apache/trafficcontrol/issues/2564) Renamed RASCAL references to TRAFFIC_MONITOR
Review Comment:
Why does #7192 add a changelog entry for #7068?
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [trafficcontrol] zrhoffman commented on pull request #7192: update health-client to v4 API
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on PR #7192:
URL: https://github.com/apache/trafficcontrol/pull/7192#issuecomment-1314502931
This looks good, but let's wait until #7190 is merged or closed to merge #7192.
--
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: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org