Require activity log retention months at least the minimum (#20078)
* reject retention month updates that are less than min retention months * add changelog * reword error * switch to retention_months
This commit is contained in:
parent
5389477107
commit
c8b4afd189
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
core/activity: error when attempting to update retention configuration below the minimum
|
||||||
|
```
|
|
@ -351,6 +351,10 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log
|
||||||
return logical.ErrorResponse("retention_months cannot be 0 while enabled"), logical.ErrInvalidRequest
|
return logical.ErrorResponse("retention_months cannot be 0 while enabled"), logical.ErrInvalidRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if a.core.censusLicensingEnabled && config.RetentionMonths < a.configOverrides.MinimumRetentionMonths {
|
||||||
|
return logical.ErrorResponse("retention_months must be at least %d while Reporting is enabled", a.configOverrides.MinimumRetentionMonths), logical.ErrInvalidRequest
|
||||||
|
}
|
||||||
|
|
||||||
// Store the config
|
// Store the config
|
||||||
entry, err := logical.StorageEntryJSON(path.Join(activitySubPath, activityConfigKey), config)
|
entry, err := logical.StorageEntryJSON(path.Join(activitySubPath, activityConfigKey), config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue