From 41c97e5d4b7c7be1135612ba031a333b8e272b6c Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Thu, 11 May 2023 23:13:54 -0600 Subject: [PATCH 1/3] Fixed alert message for POST and PUT invalidationjobs API --- CHANGELOG.md | 1 + .../traffic_ops_golang/invalidationjobs/invalidationjobs.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bed1df5502..d40e4bc89e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7469](https://github.com/apache/trafficcontrol/pull/7469) *Traffic Ops* Changed logic to not report empty or missing cookies into TO error.log. ### Fixed +- [#6340](https://github.com/apache/trafficcontrol/issues/6340) *Traffic Ops* Fixed alert messages for POST and PUT invalidation jobs. - [#7511](https://github.com/apache/trafficcontrol/pull/7511) *Traffic Ops* Fixed the changelog registration message to include the username instead of duplicate email entry. - [#7465](https://github.com/apache/trafficcontrol/issues/7465) *Traffic Ops* Fixes server_capabilities v5 apis to respond with RFC3339 date/time Format - [#7441](https://github.com/apache/trafficcontrol/pull/7441) *Traffic Ops* Fixed the invalidation jobs endpoint to respect CDN locks. diff --git a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go index 22f9d887b5..105e2be1b5 100644 --- a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go +++ b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go @@ -958,7 +958,7 @@ func UpdateV40(w http.ResponseWriter, r *http.Request) { if job.InvalidationType != input.InvalidationType { if input.InvalidationType == tc.REFETCH && !refetchAllowed(inf.Tx.Tx) { - userErr = errors.New("Invalidation Type REFRESH is disallowed") + userErr = errors.New("Invalidation Type REFETCH is disallowed") errCode = http.StatusBadRequest api.HandleErr(w, r, inf.Tx.Tx, errCode, userErr, nil) return @@ -1455,7 +1455,7 @@ func validateJobCreateV4(job tc.InvalidationJobCreateV4, tx *sql.Tx) error { } if job.InvalidationType == tc.REFETCH && !refetchAllowed(tx) { - errs = append(errs, "InvalidationType is invalid") + errs = append(errs, "invalidationType is not allowed since 'refetch_enabled' parameter doesn't exists or the value is not set to a case-sensitive 'true'") } if len(errs) > 0 { From 50e82dc48ebeb58cd812d2c4a5570126007ef16f Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Fri, 12 May 2023 16:47:00 -0600 Subject: [PATCH 2/3] merge changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d40e4bc89e..f8b8afc7e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7469](https://github.com/apache/trafficcontrol/pull/7469) *Traffic Ops* Changed logic to not report empty or missing cookies into TO error.log. ### Fixed -- [#6340](https://github.com/apache/trafficcontrol/issues/6340) *Traffic Ops* Fixed alert messages for POST and PUT invalidation jobs. +- [#6340](https://github.com/apache/trafficcontrol/issues/6340) *Traffic Ops* Fixed alert messages for POST and PUT invalidation job APIs. - [#7511](https://github.com/apache/trafficcontrol/pull/7511) *Traffic Ops* Fixed the changelog registration message to include the username instead of duplicate email entry. - [#7465](https://github.com/apache/trafficcontrol/issues/7465) *Traffic Ops* Fixes server_capabilities v5 apis to respond with RFC3339 date/time Format - [#7441](https://github.com/apache/trafficcontrol/pull/7441) *Traffic Ops* Fixed the invalidation jobs endpoint to respect CDN locks. From 4e6eeef61b1567b7e8292ec29d3ff043d9c80dcf Mon Sep 17 00:00:00 2001 From: Rima Shah Date: Mon, 22 May 2023 22:25:38 -0600 Subject: [PATCH 3/3] Fixed error message. --- .../traffic_ops_golang/invalidationjobs/invalidationjobs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go index 105e2be1b5..41a0f5a5aa 100644 --- a/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go +++ b/traffic_ops/traffic_ops_golang/invalidationjobs/invalidationjobs.go @@ -1455,7 +1455,7 @@ func validateJobCreateV4(job tc.InvalidationJobCreateV4, tx *sql.Tx) error { } if job.InvalidationType == tc.REFETCH && !refetchAllowed(tx) { - errs = append(errs, "invalidationType is not allowed since 'refetch_enabled' parameter doesn't exists or the value is not set to a case-sensitive 'true'") + errs = append(errs, "invalidationType is not allowed since 'refetch_enabled' parameter doesn't exists or the value is not set to a case-insensitive 'true'") } if len(errs) > 0 {