Fix tests using multiple controllers (#1734)
The previous PR only initialized plugins if they were required, which meant that there may not actually be a plugin manager running because a second node would not actually create the dev database, which is where the plugin was being added. The assumption that a plugin manager is running is still a fine one at the moment, but we just need to make sure it's running in _all_ cases.
This commit is contained in:
1 parent
ad8ce50f69
commit
95568ef07f
5 files changed
+17
-17
No files matched your search
@@ -126,6 +126,15 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
|
||||
|
||||
for _, enabledPlugin := range c.enabledPlugins {
|
||||
switch enabledPlugin {
|
||||
case base.EnabledPluginHostLoopback:
|
||||
plg := pluginhost.NewWrappingPluginClient(pluginhost.NewLoopbackPlugin())
|
||||
opts := []hostplugin.Option{
|
||||
hostplugin.WithDescription("Provides an initial loopback host plugin in Boundary"),
|
||||
hostplugin.WithPublicId(conf.DevLoopbackHostPluginId),
|
||||
}
|
||||
if _, err = conf.RegisterHostPlugin(ctx, "loopback", plg, opts...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
case base.EnabledPluginHostAzure, base.EnabledPluginHostAws:
|
||||
pluginType := strings.ToLower(enabledPlugin.String())
|
||||
client, cleanup, err := external_host_plugins.CreateHostPlugin(
|
||||
|
||||
@@ -20,7 +20,6 @@ import (
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/hashicorp/boundary/internal/db/schema"
|
||||
"github.com/hashicorp/boundary/internal/gen/testing/interceptor"
|
||||
"github.com/hashicorp/boundary/internal/host/plugin"
|
||||
"github.com/hashicorp/boundary/internal/iam"
|
||||
"github.com/hashicorp/boundary/internal/intglobals"
|
||||
"github.com/hashicorp/boundary/internal/kms"
|
||||
@@ -492,6 +491,9 @@ func TestControllerConfig(t *testing.T, ctx context.Context, tc *TestController,
|
||||
tc.b.DevOidcAccountId = DefaultTestOidcAccountId
|
||||
tc.b.DevUnprivilegedPasswordAccountId = DefaultTestUnprivilegedPasswordAccountId
|
||||
tc.b.DevUnprivilegedOidcAccountId = DefaultTestUnprivilegedOidcAccountId
|
||||
tc.b.DevLoopbackHostPluginId = DefaultTestPluginId
|
||||
|
||||
tc.b.EnabledPlugins = append(tc.b.EnabledPlugins, base.EnabledPluginHostLoopback)
|
||||
|
||||
// Start a logger
|
||||
tc.b.Logger = opts.Logger
|
||||
@@ -616,7 +618,6 @@ func TestControllerConfig(t *testing.T, ctx context.Context, tc *TestController,
|
||||
}
|
||||
} else if !opts.DisableDatabaseCreation {
|
||||
var createOpts []base.Option
|
||||
createOpts = append(createOpts, base.WithHostPlugin(DefaultTestPluginId, plugin.NewWrappingPluginClient(plugin.NewLoopbackPlugin())))
|
||||
if opts.DisableAuthMethodCreation {
|
||||
createOpts = append(createOpts, base.WithSkipAuthMethodCreation())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user