Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Disallow deleting or moving the last server in a Cache Group used by a topology#5155

Merged
rawlinp merged 3 commits intoapache:masterfrom
zrhoffman:top-disallow-making-cgs-empty
Oct 14, 2020
Merged

Disallow deleting or moving the last server in a Cache Group used by a topology#5155
rawlinp merged 3 commits intoapache:masterfrom
zrhoffman:top-disallow-making-cgs-empty

Conversation

@zrhoffman
Copy link
Member

@zrhoffman zrhoffman commented Oct 14, 2020

What does this PR (Pull Request) do?

Which Traffic Control components are affected by this PR?

  • Documentation
  • Traffic Control Client
  • Traffic Ops

What is the best way to verify this PR?

  1. Run the API tests

  2. Test manually:
    For DELETE /api/3.0/servers/{{id}}:

    1. Make a Cache Group
    2. Add only 1 Server to the Cache Group
    3. Make a Topology with that Cache Group
    4. Delete the Server (should fail)

    For PUT /api/3.0/servers/{{id}}:

    1. Make a Cache Group
    2. Add only 1 Server to the Cache Group
    3. Make a Topology with that Cache Group
    4. Move the Server to a different Cache Group (should fail)

The following criteria are ALL met by this PR

  • This PR includes tests
  • This PR includes documentation
  • This PR includes an update to CHANGELOG.md
  • This PR includes any and all required license headers
  • This PR does not include a database migration
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

Additional Information

    - Optionally require that the cachegroup is in an existing topology
    - Optionally exclude an array of server IDs
  - Disallow moving the last server in a cachegroup used by a topology
    to a different cachegroup
@zrhoffman zrhoffman added new feature A new feature, capability or behavior Traffic Ops related to Traffic Ops TO Client (Go) related to the Go implementation of a TC client labels Oct 14, 2020
@zrhoffman zrhoffman added this to the Flexible Topologies milestone Oct 14, 2020
Copy link
Member

@mitchell852 mitchell852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performed manual tests via TP via the API. worked great. didn't look at code however.

@rawlinp rawlinp merged commit 5e09f1e into apache:master Oct 14, 2020
@zrhoffman zrhoffman deleted the top-disallow-making-cgs-empty branch October 14, 2020 23:59
@zrhoffman zrhoffman removed this from the Flexible Topologies milestone Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new feature A new feature, capability or behavior TO Client (Go) related to the Go implementation of a TC client Traffic Ops related to Traffic Ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traffic Ops should prohibit deleting the last Server in a Cache Group that is assigned to a Topology

3 participants