trafficcontrol
trafficcontrol copied to clipboard
Port TO check scripts to Go
This PR includes all changes from #4010, but has been modified to use the newer V3 API, and with all merge conflicts resolved.
The original PR ported several check scripts from Perl to Go. Key changes from original PR:
This change ports (most) of the legacy perl server checks to go.
- Performance (and logic problems) of the original DSCP check script was the primary motivation - in our environment, the DSCP scan was taking ~20 hours to run, and the results were unreliable.
- ADD support for performing DSCP checks of SSL delivery services, which was previously missing.
- ADD option to FQDN check for validating PTR records
- Other scripts were ported over for sake of consistency.
Closes: #4010
Which Traffic Control components are affected by this PR?
- Documentation
- Traffic Ops
- Automation (build Docker image for Traffic Ops)
What is the best way to verify this PR?
- Pull code locally and build the Traffic Ops RPM with
./pkg -b traffic_ops_build. Install Traffic Ops from RPM and verify binaries are present alongside existing Perl scripts in thechecks/directory. OR - Manually build using Go v1.17 or later (requires
libpcap-devel,libpcap-devor WinPcap on non-MacOS systems):
# From project root
cd traffic_ops
go mod vendor -v
cd app/bin/checks
go build -v -o ToATSCheck ToATSCheck.go
go build -v -o ToCheck ToCheck.go
go build -v -o ToDSCPCheck ToDSCPCheck.go
go build -v -o ToFQDNCheck ToFQDNCheck.go
go build -v -o ToPingCheck ToPingCheck.go
GitHub Actions is failing on my fork because GHA pulls the build Docker image instead of building from the Dockerfile, so the libpcap-devel dependency is missing when GHA runs.
PR submission checklist
- [ ] This PR has tests (original PR and existing Perls scripts do not have tests. Suggestions for testing methods are welcome)
- [x] This PR has documentation
- [x] This PR has a CHANGELOG.md entry
- [x] This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)
In addition to failing checks, there are a lot of warnings being output by the documentation build action on this PR