open-nomad/nomad/server_setup.go
Michael Schurter 0114bcfe5b
core: move LicenseConfig to shared file (#14247)
This moves LicenseConfig and its Copy method to a shared file so that it can be shared with enterprise code.
2022-08-23 13:44:10 -07:00

32 lines
661 B
Go

package nomad
import (
"github.com/hashicorp/go-hclog"
"golang.org/x/exp/slices"
)
// LicenseConfig allows for tunable licensing config
// primarily used for enterprise testing
type LicenseConfig struct {
// 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
Logger hclog.InterceptLogger
}
func (c *LicenseConfig) Copy() *LicenseConfig {
if c == nil {
return nil
}
nc := *c
nc.AdditionalPubKeys = slices.Clone(c.AdditionalPubKeys)
return &nc
}