Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita21395a

Browse files
committed
chore: remove global retention fallback for audit logs
Audit logs retention is now explicit - it's enabled when--audit-logs-retention is set to a non-zero duration, anddisabled when set to 0. No fallback to global retention.
1 parentbca5eea commita21395a

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

‎coderd/database/dbpurge/dbpurge.go‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ func New(ctx context.Context, logger slog.Logger, db database.Store, vals *coder
131131

132132
varpurgedAuditLogsint64
133133
auditLogsRetention:=vals.Retention.AuditLogs.Value()
134-
ifauditLogsRetention==0 {
135-
auditLogsRetention=vals.Retention.Global.Value()
136-
}
137134
ifauditLogsRetention>0 {
138135
deleteAuditLogsBefore:=start.Add(-auditLogsRetention)
139136
purgedAuditLogs,err=tx.DeleteOldAuditLogs(ctx, database.DeleteOldAuditLogsParams{

‎coderd/database/dbpurge/dbpurge_test.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,17 +1087,6 @@ func TestDeleteOldAuditLogs(t *testing.T) {
10871087
expectOldDeleted:false,
10881088
expectedLogsRemaining:1,// old log is kept
10891089
},
1090-
{
1091-
name:"GlobalRetentionFallback",
1092-
retentionConfig: codersdk.RetentionConfig{
1093-
Global:serpent.Duration(retentionPeriod),
1094-
AuditLogs:serpent.Duration(0),// Not set, should fall back to global
1095-
},
1096-
oldLogTime:afterThreshold,
1097-
recentLogTime:&beforeThreshold,
1098-
expectOldDeleted:true,
1099-
expectedLogsRemaining:1,// only recent log remains
1100-
},
11011090
}
11021091

11031092
for_,tc:=rangetestCases {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp