7921f044e5
Nomad's original autopilot was importing from a private package in Consul. It has been moved out to a shared library. Switch Nomad to use this library so that we can eliminate the import of Consul, which is necessary to build Nomad ENT with the current version of the Consul SDK. This also will let us pick up autopilot improvements shared with Consul more easily.
40 lines
823 B
Go
40 lines
823 B
Go
//go:build !ent
|
|
// +build !ent
|
|
|
|
package nomad
|
|
|
|
import (
|
|
autopilot "github.com/hashicorp/raft-autopilot"
|
|
)
|
|
|
|
type EnterpriseState struct{}
|
|
|
|
func (es *EnterpriseState) Features() uint64 {
|
|
return 0
|
|
}
|
|
|
|
func (es *EnterpriseState) ReloadLicense(_ *Config) error {
|
|
return nil
|
|
}
|
|
|
|
func (s *Server) setupEnterprise(config *Config) error {
|
|
// Set up the OSS version of autopilot
|
|
apDelegate := &AutopilotDelegate{s}
|
|
|
|
s.autopilot = autopilot.New(
|
|
s.raft,
|
|
apDelegate,
|
|
autopilot.WithLogger(s.logger),
|
|
autopilot.WithReconcileInterval(config.AutopilotInterval),
|
|
autopilot.WithUpdateInterval(config.ServerHealthInterval),
|
|
autopilot.WithPromoter(s.autopilotPromoter()),
|
|
)
|
|
|
|
return nil
|
|
}
|
|
func (s *Server) startEnterpriseBackground() {}
|
|
|
|
func (s *Server) entVaultDelegate() *VaultNoopDelegate {
|
|
return &VaultNoopDelegate{}
|
|
}
|