2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-10-01 13:59:55 +00:00
|
|
|
//go:build !ent
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
package nomad
|
|
|
|
|
2018-09-15 23:23:13 +00:00
|
|
|
import (
|
2022-09-01 18:27:10 +00:00
|
|
|
autopilot "github.com/hashicorp/raft-autopilot"
|
2018-09-15 23:23:13 +00:00
|
|
|
)
|
2017-12-18 21:16:23 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
type EnterpriseState struct{}
|
|
|
|
|
2020-05-27 17:46:52 +00:00
|
|
|
func (es *EnterpriseState) Features() uint64 {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2021-03-23 13:08:14 +00:00
|
|
|
func (es *EnterpriseState) ReloadLicense(_ *Config) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
func (s *Server) setupEnterprise(config *Config) error {
|
2017-12-18 21:16:23 +00:00
|
|
|
// Set up the OSS version of autopilot
|
|
|
|
apDelegate := &AutopilotDelegate{s}
|
2022-09-01 18:27:10 +00:00
|
|
|
|
|
|
|
s.autopilot = autopilot.New(
|
|
|
|
s.raft,
|
|
|
|
apDelegate,
|
|
|
|
autopilot.WithLogger(s.logger),
|
|
|
|
autopilot.WithReconcileInterval(config.AutopilotInterval),
|
|
|
|
autopilot.WithUpdateInterval(config.ServerHealthInterval),
|
|
|
|
autopilot.WithPromoter(s.autopilotPromoter()),
|
|
|
|
)
|
2017-12-18 21:16:23 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
func (s *Server) startEnterpriseBackground() {}
|
2020-07-17 14:41:45 +00:00
|
|
|
|
|
|
|
func (s *Server) entVaultDelegate() *VaultNoopDelegate {
|
|
|
|
return &VaultNoopDelegate{}
|
|
|
|
}
|