mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
allow all build contexts to use noOpAuditor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
@@ -1081,3 +1082,26 @@ func (a *Agent) setupConsul(consulConfig *config.ConsulConfig) error {
|
||||
go a.consulService.Run()
|
||||
return nil
|
||||
}
|
||||
|
||||
// noOpAuditor is a no-op Auditor that fulfills the
|
||||
// event.Auditor interface.
|
||||
type noOpAuditor struct{}
|
||||
|
||||
// Ensure noOpAuditor is an Auditor
|
||||
var _ event.Auditor = &noOpAuditor{}
|
||||
|
||||
func (e *noOpAuditor) Event(ctx context.Context, eventType string, payload interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) Enabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) Reopen() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) SetEnabled(enabled bool) {}
|
||||
|
||||
func (e *noOpAuditor) DeliveryEnforced() bool { return false }
|
||||
|
||||
@@ -3,34 +3,10 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/nomad/command/agent/event"
|
||||
"github.com/hashicorp/nomad/nomad/structs/config"
|
||||
)
|
||||
|
||||
type noOpAuditor struct{}
|
||||
|
||||
// Ensure noOpAuditor is an Eventer
|
||||
var _ event.Auditor = &noOpAuditor{}
|
||||
|
||||
func (e *noOpAuditor) Event(ctx context.Context, eventType string, payload interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) Enabled() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) Reopen() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *noOpAuditor) SetEnabled(enabled bool) {}
|
||||
|
||||
func (e *noOpAuditor) DeliveryEnforced() bool { return false }
|
||||
|
||||
func (a *Agent) setupEnterpriseAgent(log hclog.Logger) error {
|
||||
// configure eventer
|
||||
a.auditor = &noOpAuditor{}
|
||||
|
||||
Reference in New Issue
Block a user