-
Notifications
You must be signed in to change notification settings - Fork 344
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
Adding check to make sure that you cannot add two servers with identical content #5415
Conversation
it's weird that you could do this before because I thought there was a database constraint to enforce unique IP/profile so at the very least you'd get a 500. |
I think that was for API 3.x onwards. |
No, there was definitely a constraint before API 3.x, but then 3.x moved things around so the constraint was replaced with these triggers: |
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Outdated
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Outdated
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Outdated
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Outdated
Show resolved
Hide resolved
traffic_ops/app/db/migrations/2021010900000000_server_ip_profile_trigger_update.sql
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Unit and API tests pass, goose up/down work, tested manually and works as expected
What does this PR (Pull Request) do?
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Using API 1.x, create a server using the POST API call.
Now, try to add the same server again using the same POST API call -> You should see an error saying that another server exists with the same profile/ IP address combination.
If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR
Additional Information