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 @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added layered profile feature to 4.0 for `GET` /deliveryservices/{id}/servers/ and /deliveryservices/{id}/servers/eligible.

### Fixed
- [#6291](https://github.com/apache/trafficcontrol/issues/6291) Prevent Traffic Ops from modifying and/or deleting reserved statuses.
- Update traffic\_portal dependencies to mitigate `npm audit` issues.
- Fixed a cdn-in-a-box build issue when using `RHEL_VERSION=7`
- `dequeueing` server updates should not require checking for cdn locks.
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-apply-diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
func TestApplyDiff(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func verifyUpdateStatusIsTrue() error {
func TestT3cUnsetsUpdateFlag(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const childCacheHostName = DefaultCacheHostName
func TestWaitForParentsTrue(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down Expand Up @@ -147,7 +147,7 @@ func TestWaitForParentsTrue(t *testing.T) {
func TestWaitForParentsDefaultReval(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestWaitForParentsDefaultReval(t *testing.T) {
func TestWaitForParentsFalse(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestT3cCreateEmptyFile(t *testing.T) {
// t3c must create semantically blank files. Failing to do so will cause other config files that reference them to fail.
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-dns-local-bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
func TestT3CDNSLocalBind(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-fail-log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func TestT3cApplyFailMsg(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
func TestT3cGit(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-ims_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
func TestIMS(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
func TestT3CJobs(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-lockfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
func TestLockfile(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func testNoOutgoingIPAfterUpdate(t *testing.T, noOutgoingIP *bool) {
func TestT3CNoOutgoingIP(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
func TestT3cApplyOSHostnameShort(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c-reload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
func TestT3cReload(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices, tcdata.InvalidationJobs}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func checkDiff(fName, atsUid, atsGid string, t *testing.T) {
func TestT3cBadassAndSyncDs(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/t3c_update_to_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
func TestT3cTOUpdates(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices, tcdata.InvalidationJobs}, func() {
Expand Down
29 changes: 0 additions & 29 deletions cache-config/testing/ort-tests/tc-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -4535,35 +4535,6 @@
"type": "AAAA_RECORD"
}
],
"statuses": [
{
"description": "Edge: Puts server in CCR config file in this state, but CCR will never route traffic to it. Mid: Server will not be included in parent.config files for its edge caches",
"name": "OFFLINE"
},
{
"description": "Edge: Puts server in CCR config file in this state, and CCR will always route traffic to it. Mid: Server will be included in parent.config files for its edges",
"name": "ONLINE"
},
{
"description": "Edge: Puts server in CCR config file in this state, and CCR will adhere to the health protocol. Mid: N/A for now",
"name": "REPORTED"
},
{
"description": "Temporary down. Edge: XMPP client will send status OFFLINE to CCR, otherwise similar to REPORTED. Mid: Server will not be included in parent.config files for its edge caches",
"name": "ADMIN_DOWN"
},
{
"description": "Edge: 12M will not include caches in this state in CCR config files. Mid: N/A for now",
"name": "CCR_IGNORE"
},
{
"description": "Pre Production. Not active in any configuration.",
"name": "PRE_PROD"
},
{
"name": "TEST_NULL_DESCRIPTION"
}
],
"tenants": [
{
"active": true,
Expand Down
62 changes: 0 additions & 62 deletions cache-config/testing/ort-tests/tcdata/statuses.go

This file was deleted.

2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/tcdata/todb.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (r *TCData) Teardown(db *sql.DB) error {
DELETE FROM cachegroup;
DELETE FROM coordinate;
DELETE FROM type;
DELETE FROM status;
DELETE FROM status s WHERE s.name NOT IN ('OFFLINE', 'ONLINE', 'PRE_PROD', 'ADMIN_DOWN', 'REPORTED');
DELETE FROM snapshot;
DELETE FROM cdn;
DELETE FROM service_category;
Expand Down
2 changes: 0 additions & 2 deletions cache-config/testing/ort-tests/tcdata/withobjs.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const (
ServerServerCapabilities
Servers
ServiceCategories
Statuses
StaticDNSEntries
SteeringTargets
Tenants
Expand Down Expand Up @@ -99,7 +98,6 @@ func (r *TCData) WithObjs(t *testing.T, objs []TCObj, f func()) {
ServerServerCapabilities: {r.CreateTestServerServerCapabilities, r.DeleteTestServerServerCapabilities},
Servers: {r.CreateTestServers, r.DeleteTestServers},
ServiceCategories: {r.CreateTestServiceCategories, r.DeleteTestServiceCategories},
Statuses: {r.CreateTestStatuses, r.DeleteTestStatuses},
StaticDNSEntries: {r.CreateTestStaticDNSEntries, r.DeleteTestStaticDNSEntries},
SteeringTargets: {r.SetupSteeringTargets, r.DeleteTestSteeringTargets},
Tenants: {r.CreateTestTenants, r.DeleteTestTenants},
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/to_requester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Package struct {
func TestTORequester(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices}, func() {
Expand Down
2 changes: 1 addition & 1 deletion cache-config/testing/ort-tests/to_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
func TestTOUpdater(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
tcdata.DeliveryServices, tcdata.InvalidationJobs}, func() {
Expand Down
3 changes: 3 additions & 0 deletions lib/go-tc/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ const (
// by Traffic Monitor. The vast majority of cache servers should have this
// Status.
CacheStatusReported = CacheStatus("REPORTED")
// CacheStatusPreProd represents a cache server that is not deployed to "production",
// but is ready for it.
CacheStatusPreProd = CacheStatus("PRE_PROD")
// CacheStatusInvalid represents an unrecognized Status value. Note that
// this is not actually "invalid", because Statuses may have any unique
// name, not just those captured as CacheStatus values in this package.
Expand Down
18 changes: 18 additions & 0 deletions lib/go-tc/statuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@ type StatusNullable struct {
LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
Name *string `json:"name" db:"name"`
}

// IsReservedStatus returns true if the passed in status name is reserved, and false if it isn't.
// Currently, the reserved statuses are OFFLINE, ONLINE, REPORTED, PRE_PROD and ADMIN_DOWN.
func IsReservedStatus(status string) bool {
Comment thread
srijeet0406 marked this conversation as resolved.
switch CacheStatus(status) {
case CacheStatusOffline:
fallthrough
case CacheStatusReported:
fallthrough
case CacheStatusOnline:
fallthrough
case CacheStatusPreProd:
fallthrough
case CacheStatusAdminDown:
return true
}
return false
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func startHealthClient() {
func TestHealthClientStartup(t *testing.T) {
tcd.WithObjs(t, []tcdata.TCObj{
tcdata.CDNs, tcdata.Types, tcdata.Tenants, tcdata.Parameters,
tcdata.Profiles, tcdata.ProfileParameters, tcdata.Statuses,
tcdata.Profiles, tcdata.ProfileParameters,
tcdata.Divisions, tcdata.Regions, tcdata.PhysLocations,
tcdata.CacheGroups, tcdata.Servers, tcdata.Topologies,
}, func() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

INSERT INTO public.status ("name", description) VALUES ('ONLINE', 'Server is online.') ON CONFLICT ("name") DO NOTHING;
INSERT INTO public.status ("name", description) VALUES ('OFFLINE', 'Server is Offline. Not active in any configuration.') ON CONFLICT ("name") DO NOTHING;
INSERT INTO public.status ("name", description) VALUES ('REPORTED', 'Server is online and reported in the health protocol.') ON CONFLICT ("name") DO NOTHING;
INSERT INTO public.status ("name", description) VALUES ('ADMIN_DOWN', 'Sever is administrative down and does not receive traffic.') ON CONFLICT ("name") DO NOTHING;
INSERT INTO public.status ("name", description) VALUES ('PRE_PROD', 'Pre Production. Not active in any configuration.') ON CONFLICT ("name") DO NOTHING;

Loading