From 5d132556078adb8e6cc7f9275439e4cdb8c5893f Mon Sep 17 00:00:00 2001 From: miagilepner Date: Thu, 13 Apr 2023 16:38:31 +0200 Subject: [PATCH] Revert "backport of commit b4fab6ac2ae830f3bec8c287f07d5193dcfcdc22 (#20117)" (#20142) This reverts commit 57086ad4cd1abdd28351537b315fc7966a8ff7c1. --- changelog/19891.txt | 3 --- command/server/config_test_helpers.go | 1 - command/server/config_test_helpers_util.go | 1 - vault/activity_log.go | 10 ---------- vault/core.go | 3 --- vault/logical_system_activity.go | 5 ----- vault/testing.go | 1 - 7 files changed, 24 deletions(-) delete mode 100644 changelog/19891.txt diff --git a/changelog/19891.txt b/changelog/19891.txt deleted file mode 100644 index b030151e858b..000000000000 --- a/changelog/19891.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:improvement -core (enterprise): add configuration for license reporting -``` \ No newline at end of file diff --git a/command/server/config_test_helpers.go b/command/server/config_test_helpers.go index 864eefa088bc..94535b43829a 100644 --- a/command/server/config_test_helpers.go +++ b/command/server/config_test_helpers.go @@ -1097,7 +1097,6 @@ func testParseSeals(t *testing.T) { }, }, } - addExpectedDefaultEntConfig(expected) config.Prune() require.Equal(t, config, expected) } diff --git a/command/server/config_test_helpers_util.go b/command/server/config_test_helpers_util.go index 54718050db72..63fa3cfe6a80 100644 --- a/command/server/config_test_helpers_util.go +++ b/command/server/config_test_helpers_util.go @@ -3,5 +3,4 @@ package server func addExpectedEntConfig(c *Config, sentinelModules []string) {} -func addExpectedDefaultEntConfig(c *Config) {} func addExpectedEntSanitizedConfig(c map[string]interface{}, sentinelModules []string) {} diff --git a/vault/activity_log.go b/vault/activity_log.go index ef71a9e0ae93..d45525f2f21a 100644 --- a/vault/activity_log.go +++ b/vault/activity_log.go @@ -193,9 +193,6 @@ type ActivityLogCoreConfig struct { // CensusReportInterval is the testing configuration for time CensusReportInterval time.Duration - - // MinimumRetentionMonths defines the minimum value for retention - MinimumRetentionMonths int } // NewActivityLog creates an activity log. @@ -956,10 +953,6 @@ func (a *ActivityLog) SetConfigInit(config activityConfig) { a.defaultReportMonths = config.DefaultReportMonths a.retentionMonths = config.RetentionMonths - if a.retentionMonths < a.configOverrides.MinimumRetentionMonths { - a.retentionMonths = a.configOverrides.MinimumRetentionMonths - } - if a.configOverrides.CensusReportInterval > 0 { a.CensusReportInterval = a.configOverrides.CensusReportInterval } @@ -1017,9 +1010,6 @@ func (a *ActivityLog) SetConfig(ctx context.Context, config activityConfig) { a.defaultReportMonths = config.DefaultReportMonths a.retentionMonths = config.RetentionMonths - if a.retentionMonths < a.configOverrides.MinimumRetentionMonths { - a.retentionMonths = a.configOverrides.MinimumRetentionMonths - } // check for segments out of retention period, if it has changed go a.retentionWorker(ctx, time.Now(), a.retentionMonths) diff --git a/vault/core.go b/vault/core.go index 63f3f9dc6dd9..59df4057ac9c 100644 --- a/vault/core.go +++ b/vault/core.go @@ -641,9 +641,6 @@ type Core struct { // censusAgent is the mechanism used for reporting Vault's billing data. censusAgent *CensusAgent - // censusLicensingEnabled records whether Vault is exporting census metrics - censusLicensingEnabled bool - // activeTime is set on active nodes indicating the time at which this node // became active. activeTime time.Time diff --git a/vault/logical_system_activity.go b/vault/logical_system_activity.go index 9c121db67829..4d743379df3f 100644 --- a/vault/logical_system_activity.go +++ b/vault/logical_system_activity.go @@ -322,11 +322,6 @@ func (b *SystemBackend) handleActivityConfigUpdate(ctx context.Context, req *log if config.Enabled == "enable" && enabledStr == "disable" || !activityLogEnabledDefault && config.Enabled == "enable" && enabledStr == "default" || activityLogEnabledDefault && config.Enabled == "default" && enabledStr == "disable" { - - // if census is enabled, the activity log cannot be disabled - if a.core.censusLicensingEnabled { - return logical.ErrorResponse("cannot disable the activity log while Reporting is enabled"), logical.ErrInvalidRequest - } warnings = append(warnings, "the current monthly segment will be deleted because the activity log was disabled") } diff --git a/vault/testing.go b/vault/testing.go index a8e59db7fd6b..cce0d54ac671 100644 --- a/vault/testing.go +++ b/vault/testing.go @@ -236,7 +236,6 @@ func TestCoreWithSealAndUINoCleanup(t testing.T, opts *CoreConfig) *Core { } conf.ActivityLogConfig = opts.ActivityLogConfig - testApplyEntBaseConfig(conf, opts) c, err := NewCore(conf) if err != nil {