Revert "backport of commit b4fab6ac2a (#20117)" (#20142)

This reverts commit 57086ad4cd.
This commit is contained in:
miagilepner
2023-04-13 16:38:31 +02:00
committed by GitHub
parent 4fa8facbd1
commit 5d13255607
7 changed files with 0 additions and 24 deletions

View File

@@ -1,3 +0,0 @@
```release-note:improvement
core (enterprise): add configuration for license reporting
```

View File

@@ -1097,7 +1097,6 @@ func testParseSeals(t *testing.T) {
},
},
}
addExpectedDefaultEntConfig(expected)
config.Prune()
require.Equal(t, config, expected)
}

View File

@@ -3,5 +3,4 @@
package server
func addExpectedEntConfig(c *Config, sentinelModules []string) {}
func addExpectedDefaultEntConfig(c *Config) {}
func addExpectedEntSanitizedConfig(c map[string]interface{}, sentinelModules []string) {}

View File

@@ -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)

View File

@@ -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

View File

@@ -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")
}

View File

@@ -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 {