This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Fix atscfg meta to omit config files for nonexistent delivery services#4256
Merged
Conversation
This fixes atscfg to omit files with location parameters for config files, hdr_rw_, regex_remap_, url_sig_, and uri_signing_ for DSes which don't exist (typically after deleting a DS but forgetting to delete the corresponding location Parameters). This is important to make atstccfg work because without it, ORT will request url_sig_ files for DSes which don't exist, and the API endpoint to get the keys will fail. Because atstccfg uses the API, there's no reasonable way to make it work, except to fix the meta config to omit those nonexistent files. In addition to nonexistent files, this also omits files for DSes not assigned to the server. There won't even be remap lines for those DSes anyway, so it's better and safer to omit the ancillary files altogether.
rob05c
force-pushed
the
atscfg-omit-meta-wrong-dses
branch
from
January 4, 2020 00:50
d93b6cf to
37760cd
Compare
ezelkow1
approved these changes
Jan 7, 2020
rawlinp
suggested changes
Jan 8, 2020
Contributor
There was a problem hiding this comment.
Unit tests pass, but getting this TO API test failure in this PR but not the commit before it:
=== RUN TestATSConfigMeta
--- FAIL: TestATSConfigMeta (2.13s)
atsconfig_meta_test.go:67: Getting server 'atlanta-edge-01' config list: expected: hdr_rw_mid_anymap-ds.config actual: not found
Member
Author
|
Ah, looks like the test isn't assigning the DS it's testing to that server. Thanks for finding that! I'll fix. |
Member
Author
|
Ok, I fixed the API test. API tests all pass for me (after fixing Perl number-string issues), unit tests pass. |
rawlinp
approved these changes
Jan 9, 2020
rawlinp
left a comment
Contributor
There was a problem hiding this comment.
UTs and TO API tests pass, verified that a hdr_rw location param for a DS that didn't exist was omitted from the config meta API result as expected, observed that the new warnings were logged for those params.
rob05c
added a commit
to rob05c/trafficcontrol
that referenced
this pull request
Jan 9, 2020
apache#4256) * Fix atscfg meta to omit nonexistent ds files This fixes atscfg to omit files with location parameters for config files, hdr_rw_, regex_remap_, url_sig_, and uri_signing_ for DSes which don't exist (typically after deleting a DS but forgetting to delete the corresponding location Parameters). This is important to make atstccfg work because without it, ORT will request url_sig_ files for DSes which don't exist, and the API endpoint to get the keys will fail. Because atstccfg uses the API, there's no reasonable way to make it work, except to fix the meta config to omit those nonexistent files. In addition to nonexistent files, this also omits files for DSes not assigned to the server. There won't even be remap lines for those DSes anyway, so it's better and safer to omit the ancillary files altogether. * Fix TO API test for meta cfg to set DSS, real DS (cherry picked from commit ea315f0)
rawlinp
pushed a commit
that referenced
this pull request
Jan 9, 2020
#4256) (#4278) * Fix atscfg meta to omit nonexistent ds files This fixes atscfg to omit files with location parameters for config files, hdr_rw_, regex_remap_, url_sig_, and uri_signing_ for DSes which don't exist (typically after deleting a DS but forgetting to delete the corresponding location Parameters). This is important to make atstccfg work because without it, ORT will request url_sig_ files for DSes which don't exist, and the API endpoint to get the keys will fail. Because atstccfg uses the API, there's no reasonable way to make it work, except to fix the meta config to omit those nonexistent files. In addition to nonexistent files, this also omits files for DSes not assigned to the server. There won't even be remap lines for those DSes anyway, so it's better and safer to omit the ancillary files altogether. * Fix TO API test for meta cfg to set DSS, real DS (cherry picked from commit ea315f0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes atscfg to omit files with location parameters for config
files, hdr_rw_, regex_remap_, url_sig_, and uri_signing_ for DSes
which don't exist (typically after deleting a DS but forgetting to
delete the corresponding location Parameters).
This is important to make atstccfg work because without it, ORT will
request url_sig_ files for DSes which don't exist, and the API
endpoint to get the keys will fail. Because atstccfg uses the API,
there's no reasonable way to make it work, except to fix the meta
config to omit those nonexistent files.
In addition to nonexistent files, this also omits files for DSes
not assigned to the server. There won't even be remap lines for
those DSes anyway, so it's better and safer to omit the ancillary
files altogether.
Tagged major, because it causes bad data to break ORT, where it previously didn't and doesn't need to.
Includes tests.
Includes changelog.
No documentation, bug fix.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Run tests. Request meta config
/api/1.4/servers/{id}/configfiles/atson a TO with location parameters for a nonexistent DS (the odds are good your Production environment has some), and verify those files are no longer in the returned JSON.If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR
Additional Information