Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- [#6368](https://github.com/apache/trafficcontrol/pull/6368) Fixed validation response message from `/acme_accounts`
- [#6603](https://github.com/apache/trafficcontrol/issues/6603) Fixed users with "admin" "Priv Level" not having Permission to view or delete DNSSEC keys.
- Fixed Traffic Router to handle aggressive NSEC correctly.
- [#6907](https://github.com/apache/trafficcontrol/issues/6907) Fixed Traffic Ops to return the correct server structure (based on the API version) upon a server deletion.
- [#6626](https://github.com/apache/trafficcontrol/pull/6626) Fixed t3c Capabilities request failure issue which could result in malformed config.
- [#6370](https://github.com/apache/trafficcontrol/pull/6370) Fixed docs for `POST` and response code for `PUT` to `/acme_accounts` endpoint
- Only `operations` and `admin` roles should have the `DELIVERY-SERVICE:UPDATE` permission.
Expand Down
22 changes: 16 additions & 6 deletions traffic_ops/traffic_ops_golang/server/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ func Delete(w http.ResponseWriter, r *http.Request) {
return
}

if inf.Version.Major >= 3 {
if inf.Version.Major >= 4 {
api.WriteRespAlertObj(w, r, tc.SuccessLevel, "Server deleted", server)
} else {
csp, err := dbhelpers.GetCommonServerPropertiesFromV4(server, tx)
Expand All @@ -2592,13 +2592,23 @@ func Delete(w http.ResponseWriter, r *http.Request) {
api.HandleErr(w, r, tx, errCode, userErr, sysErr)
return
}
serverV2, err := server.ToServerV2FromV4(csp)
if err != nil {
api.HandleErr(w, r, tx, http.StatusInternalServerError, nil, err)
return
if inf.Version.Major >= 3 {
serverv3, err := server.ToServerV3FromV4(csp)
if err != nil {
api.HandleErr(w, r, tx, http.StatusInternalServerError, nil, err)
return
}
api.WriteRespAlertObj(w, r, tc.SuccessLevel, "Server deleted", serverv3)
} else {
serverV2, err := server.ToServerV2FromV4(csp)
if err != nil {
api.HandleErr(w, r, tx, http.StatusInternalServerError, nil, err)
return
}
api.WriteRespAlertObj(w, r, tc.SuccessLevel, "server was deleted.", serverV2)
}
api.WriteRespAlertObj(w, r, tc.SuccessLevel, "server was deleted.", serverV2)
}

changeLogMsg := fmt.Sprintf("SERVER: %s.%s, ID: %d, ACTION: deleted", *server.HostName, *server.DomainName, *server.ID)
api.CreateChangeLogRawTx(api.ApiChange, changeLogMsg, inf.User, tx)
}