srijeet0406 commented on code in PR #7065:
URL: https://github.com/apache/trafficcontrol/pull/7065#discussion_r969976940
##########
traffic_ops/traffic_ops_golang/server/update.go:
##########
@@ -296,9 +296,16 @@ func UpdateHandlerV4(w http.ResponseWriter, r
*http.Request) {
api.HandleErr(w, r, inf.Tx.Tx, http.StatusInternalServerError,
nil, err)
return
}
- userErr, sysErr, statusCode :=
dbhelpers.CheckIfCurrentUserHasCdnLock(inf.Tx.Tx, string(cdnName),
inf.User.UserName)
- if userErr != nil || sysErr != nil {
- api.HandleErr(w, r, inf.Tx.Tx, statusCode, userErr, sysErr)
+
+ _, hasConfigUpdatedBoolParam := inf.Params["updated"]
+ _, hasRevalUpdatedBoolParam := inf.Params["reval_updated"]
+ _, hasConfigApplyTimeParam := inf.Params["config_apply_time"]
+ _, hasRevalidateApplyTimeParam := inf.Params["revalidate_apply_time"]
+ // Allow `apply_time` changes when the CDN is locked, but not `updated`
+ canIgnoreLock := (hasConfigApplyTimeParam ||
hasRevalidateApplyTimeParam) && !hasConfigUpdatedBoolParam &&
!hasRevalUpdatedBoolParam
+ userDoesntHaveLockErr, sysErr, statusCode :=
dbhelpers.CheckIfCurrentUserHasCdnLock(inf.Tx.Tx, string(cdnName),
inf.User.UserName)
Review Comment:
You just need to perform this check if `canIgnoreLock` is `false`. Else, you
don't even need to run this query.
##########
CHANGELOG.md:
##########
@@ -5,21 +5,20 @@ The format is based on [Keep a
Changelog](http://keepachangelog.com/en/1.0.0/).
## [unreleased]
### Added
-- [#2101](https://github.com/apache/trafficcontrol/issues/2101) Added the
ability to tell if a Delivery Service is the target of another steering DS.
-- [#6033](https://github.com/apache/trafficcontrol/issues/6033) Added ability
to assign multiple server capabilities to a server.
-- [#7032](https://github.com/apache/trafficcontrol/issues/7032) Add t3c-apply
flag to use local ATS version for config generation rather than Server package
Parameter, to allow managing the ATS OS package via external tools. See 'man
t3c-apply' and 'man t3c-generate' for details.
-
-- [Traffic Monitor] Added logging for `ipv4Availability` and
`ipv6Availability` in TM.
-- [Traffic Ops] Added the `ASN` field in TO Server struct, which provides the
ability to query servers by `ASN`.
+- *Traffic Monitor* Added logging for `ipv4Availability` and
`ipv6Availability` in TM.
+- *Traffic Ops* Added the `ASN` field in TO Server struct, which provides the
ability to query servers by `ASN`.
+- [#2101](https://github.com/apache/trafficcontrol/issues/2101) *Traffic
Portal* Added the ability to tell if a Delivery Service is the target of
another steering DS.
+- [#6033](https://github.com/apache/trafficcontrol/issues/6033) *Traffic Ops,
Traffic Portal* Added ability to assign multiple server capabilities to a
server.
+- [#7032](https://github.com/apache/trafficcontrol/issues/7032) *Cache Config*
Add t3c-apply flag to use local ATS version for config generation rather than
Server package Parameter, to allow managing the ATS OS package via external
tools. See 'man t3c-apply' and 'man t3c-generate' for details.
### Changed
-- Traffic Portal now obscures sensitive text in Delivery Service "Raw Remap"
fields, private SSL keys, "Header Rewrite" rules, and ILO interface passwords
by default.
-- Traffic Router now uses Traffic Ops API 4.0 by default
+- *Traffic Portal* Obscures sensitive text in Delivery Service "Raw Remap"
fields, private SSL keys, "Header Rewrite" rules, and ILO interface passwords
by default.
+- *Traffic Router* Uses Traffic Ops API 4.0 by default
### Fixed
-- Traffic Stats: Reuse InfluxDB client handle to prevent potential connection
leaks
-- [#7021](https://github.com/apache/trafficcontrol/issues/7021) Fixed cache
config for Delivery Services with IP Origins
-
+- *Traffic Stats* Reuse InfluxDB client handle to prevent potential connection
leaks.
+- [#7021](https://github.com/apache/trafficcontrol/issues/7021) *Cache Config*
Fixed cache config for Delivery Services with IP Origins.
+- [#7047](https://github.com/apache/trafficcontrol/issues/7047) *Traffic Ops*
allow `apply_time` query parameters on the `servers/{id-name}/update` when the
CDN is locked..
Review Comment:
nit: extra `.` here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]