Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated default_report_months #27350

Merged
merged 20 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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 vault/activity_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,7 @@ func (a *ActivityLog) modifyResponseMonths(months []*ResponseMonth, start time.T
type activityConfig struct {
// DefaultReportMonths are the default number of months that are returned on
// a report. The zero value uses the system default of 12.
// Deprecated: This field was removed in favor of using different default startTime and endTime values
DefaultReportMonths int `json:"default_report_months"`

// RetentionMonths defines the number of months we want to retain data. The
Expand Down
1 change: 0 additions & 1 deletion vault/activity_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ func TestActivityLog_API_ConfigCRUD_Census(t *testing.T) {
}

expected := map[string]interface{}{
"default_report_months": 12,
"retention_months": 56,
"enabled": "enable",
"queries_available": false,
Expand Down
6 changes: 3 additions & 3 deletions vault/logical_system_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (b *SystemBackend) rootActivityPaths() []*framework.Path {
Type: framework.TypeInt,
Default: 12,
Description: "Number of months to report if no start date specified.",
Deprecated: true,
},
"retention_months": {
Type: framework.TypeInt,
Expand Down Expand Up @@ -327,7 +328,6 @@ func (b *SystemBackend) handleActivityConfigRead(ctx context.Context, req *logic

return &logical.Response{
Data: map[string]interface{}{
"default_report_months": config.DefaultReportMonths,
"retention_months": config.RetentionMonths,
"enabled": config.Enabled,
"queries_available": qa,
Expand Down Expand Up @@ -357,8 +357,8 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log

{
// Parse the default report months
if defaultReportMonthsRaw, ok := d.GetOk("default_report_months"); ok {
config.DefaultReportMonths = defaultReportMonthsRaw.(int)
if _, ok := d.GetOk("default_report_months"); ok {
warnings = append(warnings, fmt.Sprintf("default_report_months is deprecated and is no longer used anywhere"))
divyaac marked this conversation as resolved.
Show resolved Hide resolved
}

if config.DefaultReportMonths <= 0 {
Expand Down
4 changes: 1 addition & 3 deletions website/content/api-docs/system/internal-counters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ The `/sys/internal/counters/config` endpoint is used to configure logging of act

### Parameters

- `default_report_months` `(integer: 12)` - The number of months to report if no `start_time` is specified in a query.
- `default_report_months` `(integer: 12)` - (*Note: This field is deprecated*) The number of months to report if no `start_time` is specified in a query.
divyaac marked this conversation as resolved.
Show resolved Hide resolved
divyaac marked this conversation as resolved.
Show resolved Hide resolved
- `enabled` `(string: enable, disable, default)` - Enable or disable counting of client activity. When set to `default`, the client
counts are enabled on Enterprise builds and disabled on community builds. Disabling the feature during the middle of a month will
discard any data recorded for that month, but does not delete previous months.
Expand All @@ -1110,7 +1110,6 @@ Any missing parameters are left at their existing value.
```json
{
"enabled": "enable",
"default_report_months": 3,
"retention_months": 54
}
```
Expand Down Expand Up @@ -1155,7 +1154,6 @@ $ curl \
"lease_duration": 0,
"renewable": false,
"data": {
"default_report_months": 12,
"enabled": "default-enabled",
"queries_available": true,
"retention_months": 48,
Expand Down
6 changes: 6 additions & 0 deletions website/content/docs/upgrading/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ verifying functionality after each cluster upgrade.
3. Finally, upgrade Cluster A. All clusters downstream of A will already be
upgraded. It should be upgraded last, as it is a Performance Primary and a DR
Primary.


## Activity Log

The field `default_report_months` can no longer be configured. Attempts to write
a value to the field will not result in any change.
divyaac marked this conversation as resolved.
Show resolved Hide resolved
divyaac marked this conversation as resolved.
Show resolved Hide resolved
divyaac marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 20 additions & 0 deletions website/content/docs/upgrading/upgrade-to-1.18.x.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
layout: docs
page_title: Upgrade to Vault 1.18.x - Guides
description: |-
Deprecations, important or breaking changes, and remediation recommendations
for anyone upgrading to 1.18.x from Vault 1.18.x.
divyaac marked this conversation as resolved.
Show resolved Hide resolved
---

# Overview

The Vault 1.18.x upgrade guide contains information on deprecations, important
or breaking changes, and remediation recommendations for anyone upgrading from
Vault 1.17. **Please read carefully**.

## Important changes

### Activity Log Changes

The field `default_report_months` can no longer be configured. Attempts to write
a value to the field will not result in any change.
divyaac marked this conversation as resolved.
Show resolved Hide resolved
divyaac marked this conversation as resolved.
Show resolved Hide resolved
Loading