From 3229cf192bb5ad0bc8351dc3e25ce00f00289779 Mon Sep 17 00:00:00 2001 From: Mike Palmiotto Date: Wed, 3 Jul 2024 13:31:56 -0400 Subject: [PATCH] Add CE plumbing for CensusManager reload (#27664) This PR adds the CE plumbing and stubs for forcing agent instantiation whenever the Vault license changes. Resolves: VAULT-28583 Enterprise PR: hashicorp/vault-enterprise#6168 --- command/server.go | 2 +- command/server_util.go | 4 ++++ vault/census_stubs_oss.go | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/command/server.go b/command/server.go index 35ced21ffd..97ba1ffea3 100644 --- a/command/server.go +++ b/command/server.go @@ -1711,7 +1711,7 @@ func (c *ServerCommand) Run(args []string) int { sr.NotifyConfigurationReload(srConfig) } - if err := core.ReloadCensusManager(); err != nil { + if err := core.ReloadCensusManager(false); err != nil { c.UI.Error(err.Error()) } diff --git a/command/server_util.go b/command/server_util.go index 4573ec14ec..c0227ea28b 100644 --- a/command/server_util.go +++ b/command/server_util.go @@ -24,6 +24,10 @@ func (c *ServerCommand) ReloadedCh() chan struct{} { return c.reloadedCh } +func (c *ServerCommand) LicenseReloadedCh() chan error { + return c.licenseReloadedCh +} + func testServerCommand(tb testing.TB) (*cli.MockUi, *ServerCommand) { tb.Helper() diff --git a/vault/census_stubs_oss.go b/vault/census_stubs_oss.go index 0b5b1c11f0..f52717a5c9 100644 --- a/vault/census_stubs_oss.go +++ b/vault/census_stubs_oss.go @@ -9,6 +9,6 @@ import "context" //go:generate go run github.com/hashicorp/vault/tools/stubmaker -func (c *Core) StartCensusReports(ctx context.Context) {} -func (c *Core) SetRetentionMonths(months int) error { return nil } -func (c *Core) ReloadCensusManager() error { return nil } +func (c *Core) StartCensusReports(ctx context.Context) {} +func (c *Core) SetRetentionMonths(months int) error { return nil } +func (c *Core) ReloadCensusManager(licenseChange bool) error { return nil }