open-nomad/nomad/license_config.go
Daniel Bennett c42950e342
ent: move all license info into LicenseConfig{} (#16738)
and add new TestConfigForServer() to get a
valid nomad.Config to use in tests

Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2023-03-30 16:15:05 -05:00

34 lines
699 B
Go

package nomad
import (
"time"
"golang.org/x/exp/slices"
)
// LicenseConfig allows for tunable licensing config
// primarily used for enterprise testing
type LicenseConfig struct {
// BuildDate is the time of the git commit used to build the program.
BuildDate time.Time
// LicenseEnvBytes is the license bytes to use for the server's license
LicenseEnvBytes string
// LicensePath is the path to use for the server's license
LicensePath string
// AdditionalPubKeys is a set of public keys to
AdditionalPubKeys []string
}
func (c *LicenseConfig) Copy() *LicenseConfig {
if c == nil {
return nil
}
nc := *c
nc.AdditionalPubKeys = slices.Clone(c.AdditionalPubKeys)
return &nc
}