mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	Deprecated default_report_months (#27350)
* Deprecated default_report_months through docs and upgrade guides * Added upgraade doc * Update website/content/docs/upgrading/upgrade-to-1.18.x.mdx Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * Update website/content/api-docs/system/internal-counters.mdx Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com> * Update website/content/docs/upgrading/upgrade-to-1.18.x.mdx Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * Update vault/logical_system_activity.go Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * updated code sample * Added changelog * Update website/content/docs/upgrading/upgrade-to-1.18.x.mdx Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * Update changelog/27350.txt Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * Update website/content/docs/upgrading/index.mdx Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> * Update upgrade-to-1.18.x.mdx * Update upgrade-to-1.18.x.mdx * Added docs nav * Edited docs nav * Edited docs --------- Co-authored-by: Mike Palmiotto <mike.palmiotto@hashicorp.com> Co-authored-by: Sarah Chavis <62406755+schavis@users.noreply.github.com>
This commit is contained in:
		
							
								
								
									
										4
									
								
								changelog/27350.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								changelog/27350.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| ```release-note:change | ||||
| activity log: Deprecated the field "default_report_months". Instead, the billing start time will be used to determine the start time | ||||
| when querying the activity log endpoints. | ||||
| ``` | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
| @@ -108,6 +108,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, | ||||
| @@ -328,7 +329,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, | ||||
| @@ -358,8 +358,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: defaulting to billing start time")) | ||||
| 		} | ||||
|  | ||||
| 		if config.DefaultReportMonths <= 0 { | ||||
|   | ||||
| @@ -1095,7 +1095,8 @@ 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)` - **DEPRECATED** The number | ||||
|    of months to report if no `start_time` is specified in a query. | ||||
| - `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. | ||||
| @@ -1108,7 +1109,6 @@ Any missing parameters are left at their existing value. | ||||
| ```json | ||||
| { | ||||
|   "enabled": "enable", | ||||
|   "default_report_months": 3, | ||||
|   "retention_months": 54 | ||||
| } | ||||
| ``` | ||||
| @@ -1153,7 +1153,6 @@ $ curl \ | ||||
|   "lease_duration": 0, | ||||
|   "renewable": false, | ||||
|   "data": { | ||||
|     "default_report_months": 12, | ||||
|     "enabled": "default-enabled", | ||||
|     "queries_available": true, | ||||
|     "retention_months": 48, | ||||
|   | ||||
							
								
								
									
										38
									
								
								website/content/docs/upgrading/upgrade-to-1.18.x.mdx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								website/content/docs/upgrading/upgrade-to-1.18.x.mdx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| --- | ||||
| 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.17.x. | ||||
| --- | ||||
|  | ||||
| # 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 or read. Any previously set values | ||||
| will be ignored by the system. | ||||
|  | ||||
|  | ||||
| Attempts to modify `default_report_months` through the | ||||
| [/sys/internal/counters/config](/vault/api-docs/system/internal-counters#update-the-client-count-configuration) | ||||
| endpoint, will result in the following warning from Vault: | ||||
|  | ||||
| <CodeBlockConfig hideClipboard> | ||||
|  | ||||
| ```shell-session | ||||
|  | ||||
| WARNING! The following warnings were returned from Vault: | ||||
|  | ||||
|   * default_report_months is deprecated: defaulting to billing start time | ||||
|  | ||||
|  | ||||
| ``` | ||||
|  | ||||
| </CodeBlockConfig> | ||||
| @@ -2325,6 +2325,10 @@ | ||||
|         "title": "Upgrade to Raft WAL", | ||||
|         "path": "upgrading/raft-wal" | ||||
|       }, | ||||
|       { | ||||
|         "title": "Upgrade to 1.18.x", | ||||
|         "path": "upgrading/upgrade-to-1.18.x" | ||||
|       }, | ||||
|       { | ||||
|         "title": "Upgrade to 1.17.x", | ||||
|         "path": "upgrading/upgrade-to-1.17.x" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 divyaac
					divyaac