agent: fewer file local differences between enterprise and oss (#6820) (#6898)

* Increase number to test ignore. Consul Enterprise has more flags and since we are trying to reduce the differences between both code bases, we are increasing the number in oss. The semantics don't change, it is just a cosmetic thing.
* Introduce agent.initEnterprise for enterprise related hooks.
* Sync test with ent version.
* Fix import order.
* revert error wording.
This commit is contained in:
Hans Hasselberg 2019-12-06 21:35:58 +01:00 committed by GitHub
parent 8ac2ac1893
commit a36e58c964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -410,6 +410,8 @@ func (a *Agent) Start() error {
// waiting to discover a consul server
consulCfg.ServerUp = a.sync.SyncFull.Trigger
a.initEnterprise(consulCfg)
tlsConfigurator, err := tlsutil.NewConfigurator(c.ToTLSUtilConfig(), a.logger)
if err != nil {
return err

8
agent/agent_oss.go Normal file
View File

@ -0,0 +1,8 @@
// +build !consulent
package agent
import "github.com/hashicorp/consul/agent/consul"
func (a *Agent) initEnterprise(consulCfg *consul.Config) {
}

View File

@ -47,7 +47,7 @@ func TestFSM_IgnoreUnknown(t *testing.T) {
Foo string
}
req := UnknownRequest{Foo: "bar"}
msgType := structs.IgnoreUnknownTypeFlag | 64
msgType := structs.IgnoreUnknownTypeFlag | 75
buf, err := structs.Encode(msgType, req)
assert.Nil(t, err)

View File

@ -1,8 +1,9 @@
package lib
import (
"github.com/hashicorp/serf/serf"
"time"
"github.com/hashicorp/serf/serf"
)
// SerfDefaultConfig returns a Consul-flavored Serf default configuration,