mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-18 18:38:08 -05:00
* 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:
parent
bb106f1bef
commit
f3695579ac
7 changed files with 26 additions and 1 deletions
|
|
@ -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'
|
||||
|
|
|
|||
4
.github/workflows/test-go.yml
vendored
4
.github/workflows/test-go.yml
vendored
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue