Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

licensing: remove raft storage and sync #10458

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
// Add Enterprise license configs
conf.LicenseEnv = agentConfig.Server.LicenseEnv
conf.LicensePath = agentConfig.Server.LicensePath
conf.LicenseConfig.AdditionalPubKeys = agentConfig.Server.licenseAdditionalPublicKeys

// Add the search configuration
if search := agentConfig.Server.Search; search != nil {
Expand Down
4 changes: 4 additions & 0 deletions command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ type ServerConfig struct {
// is set, LicenseEnv will be set to the value at startup.
LicenseEnv string

// licenseAdditionalPublicKeys is an internal-only field used to
// setup test licenses.
licenseAdditionalPublicKeys []string

// ExtraKeysHCL is used by hcl to surface unexpected keys
ExtraKeysHCL []string `hcl:",unusedKeys" json:"-"`

Expand Down
2 changes: 2 additions & 0 deletions command/agent/testagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ func (a *TestAgent) Start() *TestAgent {
if a.Config == nil {
a.Config = a.config()
}
defaultEnterpriseTestServerConfig(a.Config.Server)

if a.Config.DataDir == "" {
name := "agent"
if a.Name != "" {
Expand Down
2 changes: 2 additions & 0 deletions command/agent/testagent_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ const (
// EnterpriseTestAgent is used to configure a TestAgent's Enterprise flag
EnterpriseTestAgent = false
)

func defaultEnterpriseTestServerConfig(c *ServerConfig) {}
5 changes: 0 additions & 5 deletions command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ func Commands(metaPtr *Meta, agentUi cli.Ui) map[string]cli.CommandFactory {
Meta: meta,
}, nil
},
"license put": func() (cli.Command, error) {
return &LicensePutCommand{
Meta: meta,
}, nil
},
"logs": func() (cli.Command, error) {
return &AllocLogsCommand{
Meta: meta,
Expand Down
10 changes: 2 additions & 8 deletions command/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,12 @@ type LicenseCommand struct {
func (l *LicenseCommand) Help() string {
helpText := `
Usage: nomad license <subcommand> [options] [args]

This command has subcommands for managing the Nomad Enterprise license.
For more detailed examples see:
https://www.nomadproject.io/docs/commands/license/

Install a new license from a file:
$ nomad license put <path>

Install a new license from stdin:
$ nomad license put -

Retrieve the current license:
Retrieve the server's license:

$ nomad license get

Expand Down
167 changes: 0 additions & 167 deletions command/license_put.go

This file was deleted.

32 changes: 0 additions & 32 deletions command/license_put_test.go

This file was deleted.

1 change: 0 additions & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
_ "github.com/hashicorp/nomad/e2e/events"
_ "github.com/hashicorp/nomad/e2e/example"
_ "github.com/hashicorp/nomad/e2e/isolation"
_ "github.com/hashicorp/nomad/e2e/license"
_ "github.com/hashicorp/nomad/e2e/lifecycle"
_ "github.com/hashicorp/nomad/e2e/metrics"
_ "github.com/hashicorp/nomad/e2e/namespaces"
Expand Down
33 changes: 0 additions & 33 deletions e2e/license/license.go

This file was deleted.

4 changes: 3 additions & 1 deletion nomad/server_setup_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (

// LicenseConfig allows for tunable licensing config
// primarily used for enterprise testing
type LicenseConfig struct{}
type LicenseConfig struct {
AdditionalPubKeys []string
}

type EnterpriseState struct{}

Expand Down
4 changes: 4 additions & 0 deletions nomad/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func TestACLServer(t testing.T, cb func(*Config)) (*Server, *structs.ACLToken, f
func TestServer(t testing.T, cb func(*Config)) (*Server, func()) {
// Setup the default settings
config := DefaultConfig()

// Setup default enterprise-specific settings, including license
defaultEnterpriseTestConfig(config)

config.Logger = testlog.HCLogger(t)
config.Build = version.Version + "+unittest"
config.DevMode = true
Expand Down
5 changes: 5 additions & 0 deletions nomad/testing_oss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +build !ent

package nomad

func defaultEnterpriseTestConfig(c *Config) {}