Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TO Go CRConfig to omit null missLocations #2221

Merged
merged 1 commit into from
May 4, 2018

Conversation

rob05c
Copy link
Member

@rob05c rob05c commented May 3, 2018

This fixed the Golang CRConfig to do what Perl does: omit the missLocation field if it's null in the database.

Specifically, the Go MissLocation field is omitempty, but was always being assigned an object ( MissLocation: &tc.CRConfigLatitudeLongitudeShort{}). This changes it to only assign an object if the miss location exists.

This also warns if Lat or Lon is set, but not both. This is different from Perl, which would put whichever was set in the CRConfig. It's never useful to have Lat without Lon, so IMO that should be considered a bug, and warned, which this does.

Long term, we should make it impossible in the DB and UI to set Lat without Lon. But that's a bigger change.

@rob05c rob05c added bug something isn't working as intended Traffic Ops API (golang) labels May 3, 2018
@rob05c rob05c requested a review from mitchell852 May 3, 2018 18:53
@asfgit
Copy link
Contributor

asfgit commented May 3, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/1510/
Test PASSed.

@dewrich dewrich merged commit 98f72dd into apache:master May 4, 2018
@rob05c rob05c deleted the to-crconfig-fixnullmissloc branch January 2, 2019 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants