IBM license and config reloads (#12058) (#12251)

* adding ibm tests for ent files

* adding debug commands

* adding code changes

* adding reload tests

* remove settings.json

* remove ryboe q

* changing isHashicorpLicense to isIBMLicense and moving DiagnoseCheckLicenseGeneration to core_util_common.go

* fix test

* reverting non-license related tests

* reverting non-license related tests

* removing hashicorp license test

* modify reload server_ent_test.go

* change ibm-license paths

* adding census reload server test

* moving LicensingEntitlementSelectionConfig to core_util_common.go

* add EntReloadLicenseAndConfig to stubs

* fix operator diagnose bug

* move bug fix into ce and ent files

* add more ibm test cases

* Update command/command_testonly/server_testonly_ent_test.go



* address comments

* make fmt

---------

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
Co-authored-by: Jenny Deng <jenny.deng@hashicorp.com>
This commit is contained in:
Vault Automation 2026-02-06 18:19:44 -05:00 committed by GitHub
parent bb106f1bef
commit f3695579ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 26 additions and 1 deletions

View file

@ -42,6 +42,8 @@ runs:
kv/data/github/${{ github.repository }}/github-token username-and-token | github-token;
kv/data/github/${{ github.repository }}/license license_1 | VAULT_LICENSE_CI;
kv/data/github/${{ github.repository }}/license license_2 | VAULT_LICENSE_2;
kv/data/github/${{ github.repository }}/ibm-license license_1 | VAULT_LICENSE_IBM;
kv/data/github/${{ github.repository }}/ibm-license license_2 | VAULT_LICENSE_IBM_2;
- name: Setup Git configuration (private)
id: setup-git-private
if: github.repository == 'hashicorp/vault-enterprise'

View file

@ -129,6 +129,8 @@ jobs:
kv/data/github/${{ github.repository }}/github-token username-and-token | github-token;
kv/data/github/${{ github.repository }}/license license_1 | VAULT_LICENSE_CI;
kv/data/github/${{ github.repository }}/license license_2 | VAULT_LICENSE_2;
kv/data/github/${{ github.repository }}/ibm-license license_1 | VAULT_LICENSE_IBM;
kv/data/github/${{ github.repository }}/ibm-license license_2 | VAULT_LICENSE_IBM_2;
- if: steps.global-metadata.outputs.is-ent-repo == 'true'
name: Setup Git configuration (private)
id: setup-git-private
@ -309,6 +311,8 @@ jobs:
kv/data/github/${{ github.repository }}/github-token username-and-token | github-token;
kv/data/github/${{ github.repository }}/license license_1 | VAULT_LICENSE_CI;
kv/data/github/${{ github.repository }}/license license_2 | VAULT_LICENSE_2;
kv/data/github/${{ github.repository }}/ibm-license license_1 | VAULT_LICENSE_IBM;
kv/data/github/${{ github.repository }}/ibm-license license_2 | VAULT_LICENSE_IBM_2;
- if: needs.test-matrix.outputs.is-ent-repo == 'true'
id: setup-git-private
name: Setup Git configuration (private)

View file

@ -652,6 +652,10 @@ SEALFAIL:
if envLicense := os.Getenv(EnvVaultLicense); envLicense != "" {
coreConfig.License = envLicense
}
// Load license entitlement config
coreConfig := vault.SetDiagnoseCheckLicenseEntitlement(config, coreConfig)
vault.DiagnoseCheckLicense(licenseCtx, vaultCore, coreConfig, vault.DiagnoseCheckLicenseGeneration{
Generate: false,
})

View file

@ -1763,7 +1763,7 @@ func (c *ServerCommand) Run(args []string) int {
}
// Reload license file
if err = core.EntReloadLicense(); err != nil {
if err = core.EntReloadLicenseAndConfig(nil); err != nil {
c.UI.Error(err.Error())
}

View file

@ -36,6 +36,10 @@ func (c *Core) EntGetLicense() (string, error) {
return "", nil
}
func (c *Core) EntReloadLicenseAndConfig(mockLicenseConfigChange *LicensingEntitlementSelectionConfig) error {
return nil
}
func (c *Core) EntReloadLicense() error {
return nil
}

View file

@ -11,6 +11,7 @@ import (
"io"
"github.com/hashicorp/go-hclog"
cserver "github.com/hashicorp/vault/command/server"
"github.com/hashicorp/vault/helper/activationflags"
"github.com/hashicorp/vault/helper/namespace"
"github.com/hashicorp/vault/limits"
@ -211,6 +212,10 @@ func DiagnoseCheckLicense(ctx context.Context, vaultCore *Core, coreConfig CoreC
return false, nil
}
func SetDiagnoseCheckLicenseEntitlement(config *cserver.Config, coreConfig CoreConfig) CoreConfig {
return coreConfig
}
// createCustomMessageManager is a function implemented differently for the
// community edition and the enterprise edition. This is the community
// edition implementation. It simply constructs a uicustommessages.Manager

View file

@ -16,6 +16,12 @@ type DiagnoseCheckLicenseGeneration struct {
GenerateIBMLicense bool
}
// LicensingEntitlementSelectionConfig contains configuration options for selecting an IBM license entitlement
type LicensingEntitlementSelectionConfig struct {
Edition string
AddOns []string
}
// GetCoreConfigInternal returns the server configuration
// in struct format.
func (c *Core) GetCoreConfigInternal() *server.Config {