This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Fixes the inability to clone ds assignments across servers when 1+ ds is assigned a topology#4905
Merged
ocket8888 merged 2 commits intoapache:masterfrom Jul 23, 2020
Merged
Conversation
…g POST api/1.x|2.x|3.x/servers/{server-id}/deliveryservices
…dividually to a server
shamrickus
approved these changes
Jul 23, 2020
Member
shamrickus
left a comment
There was a problem hiding this comment.
LGTM
- TO unit/integration tests pass
- TP integration tests pass
- No
go fmtissues - Able to assign Servers to DS with Topologies
- TP disables assigning single topology based ds to a server
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.
What does this PR (Pull Request) do?
With the introduction of topologies, it no longer makes sense to assign caches directly to a delivery service if that ds utilizes a topology. Therefore, a constraint was added to the following api in #4702 to prevent delivery services from being assigned directly to a server if that delivery service utilizes a topology:
POST api/version/servers/{server-id}/deliveryservicesHowever, a common practice when provisioning new caches is to clone the ds assignments (or bulk assign) from an existing cache to the newly provisioned cache using the aforementioned endpoint. However, due to the new constraint added in #4702, this activity will inevitably fail as more delivery services start to use topologies but were never directly unassigned from the servers in which they were previously assigned. Confused yet?
Anyhow, removing this constraint will ease the transition from delivery services that utilize a topology and other delivery services that choose to assign servers directly.
In addition, when assigning ds's directly to a server, it makes no sense to directly assign topology-based ds's to a server, therefore, those ds's have been disabled (or are unselectable) in TP.
TLDR; this PR allows bulk assignment of ds's to a server even if one of those ds's utilizes a topology but prevents individual assignment of a ds with a topology to a server (in TP). Because bulk assignment is part of the new server provisioning playbook and cannot be broken.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
curl -X POST --data '[dsId]' https://trafficops.domain.com/api/3.x/servers/{server-id}/deliveryservices?replace=truewhere dsId is the id of a delivery service that utilizes a topology. The POST should succeed.-- edit a delivery service to use a topology. create a topology first if you have to.
-- view the delivery services of a server in the same cdn - https://tp.domain.com/#!/servers/{server-id}/delivery-services
-- click on the
Link Delivery Services to Serverbutton-- notice that the delivery service with the topology assigned cannot be selected for direct assignment to the server.
If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR