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 @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Changed
- Updated `t3c` to request less unnecessary deliveryservice-server assignment and invalidation jobs data via new query params supported by Traffic Ops
- [#6179](https://github.com/apache/trafficcontrol/issues/6179) Updated the Traffic Ops rpm to include the `ToDnssecRefresh` binary and make the `trafops_dnssec_refresh` cron job use it
- Changed the DNSSEC refresh Traffic Ops API to only create a new change log entry if any keys were actually refreshed or an error occurred (in order to reduce changelog noise)
- [#5927](https://github.com/apache/trafficcontrol/issues/5927) Updated CDN-in-a-Box to not run a Riak container by default but instead only run it if the optional flag is provided.

### Deprecated
Expand Down
15 changes: 11 additions & 4 deletions traffic_ops/traffic_ops_golang/cdn/dnssecrefresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func doDNSSECKeyRefresh(tx *sql.Tx, asyncDB *sqlx.DB, tv trafficvault.TrafficVau

errCount := 0
updateCount := 0
putErr := false
for _, cdnInf := range cdnDNSSECKeyParams {
keys, ok, err := tv.GetDNSSECKeys(string(cdnInf.CDNName), tx, context.Background()) // TODO get all in a map beforehand
if err != nil {
Expand Down Expand Up @@ -327,19 +328,25 @@ func doDNSSECKeyRefresh(tx *sql.Tx, asyncDB *sqlx.DB, tv trafficvault.TrafficVau
if updateCount > 0 {
if err := tv.PutDNSSECKeys(string(cdnInf.CDNName), keys, tx, context.Background()); err != nil {
log.Errorln("refreshing DNSSEC Keys: putting keys into Traffic Vault for cdn '" + string(cdnInf.CDNName) + "': " + err.Error())
errCount++
putErr = true
}
}
}
clMsg := fmt.Sprintf("Refreshed %d DNSSEC keys", updateCount)
status := api.AsyncSucceeded
msg := fmt.Sprintf("DNSSEC refresh completed successfully (%d keys were updated)", updateCount)
if errCount > 0 {
if putErr {
status = api.AsyncFailed
msg = fmt.Sprintf("DNSSEC refresh failed (attempted to update %d keys, but an error occurred while attempting to store in Traffic Vault)", updateCount)
clMsg = fmt.Sprintf("Attempted to refresh %d DNSSEC keys, but an error occurred while attempting to store in Traffic Vault", updateCount)
} else if errCount > 0 {
status = api.AsyncFailed
msg = fmt.Sprintf("DNSSEC refresh failed (%d keys were updated, but %d errors occurred)", updateCount, errCount)
msg = fmt.Sprintf("DNSSEC refresh failed (updated %d keys, but %d errors occurred)", updateCount, errCount)
clMsg = fmt.Sprintf("Refreshed %d DNSSEC keys, but %d errors occurred", updateCount, errCount)
}
api.CreateChangeLogRawTx(api.ApiChange, clMsg, user, tx)
if updateCount > 0 || errCount > 0 || putErr {
api.CreateChangeLogRawTx(api.ApiChange, clMsg, user, tx)
}
if asyncErr := api.UpdateAsyncStatus(asyncDB, status, msg, jobID, true); asyncErr != nil {
log.Errorf("updating async status for id %d: %v", jobID, asyncErr)
}
Expand Down