Register Azure and AWS at controller start up (#1570)
* Register Plugins. * Pass catalogs and persisted data when listing hosts for host sets. Register azure plugin at startup if not present.
This commit is contained in:
9 files changed
+125
-31
No files matched your search
@@ -6,18 +6,21 @@ import (
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
awsplg "github.com/hashicorp/boundary-plugin-host-aws/plugin"
|
||||
azureplg "github.com/hashicorp/boundary-plugin-host-azure/plugin"
|
||||
"github.com/hashicorp/boundary/internal/auth/oidc"
|
||||
"github.com/hashicorp/boundary/internal/auth/password"
|
||||
"github.com/hashicorp/boundary/internal/authtoken"
|
||||
"github.com/hashicorp/boundary/internal/cmd/config"
|
||||
"github.com/hashicorp/boundary/internal/credential/vault"
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
hostplugin "github.com/hashicorp/boundary/internal/host/plugin"
|
||||
pluginhost "github.com/hashicorp/boundary/internal/host/plugin"
|
||||
"github.com/hashicorp/boundary/internal/host/static"
|
||||
"github.com/hashicorp/boundary/internal/iam"
|
||||
"github.com/hashicorp/boundary/internal/kms"
|
||||
"github.com/hashicorp/boundary/internal/observability/event"
|
||||
"github.com/hashicorp/boundary/internal/plugin/host"
|
||||
hostplugin "github.com/hashicorp/boundary/internal/plugin/host"
|
||||
"github.com/hashicorp/boundary/internal/scheduler"
|
||||
"github.com/hashicorp/boundary/internal/scheduler/job"
|
||||
"github.com/hashicorp/boundary/internal/servers"
|
||||
@@ -104,6 +107,12 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := conf.CreateHostPlugin(ctx, "azure", &azureplg.AzurePlugin{}, hostplugin.WithDescription("Boundary provided host plugin for Azure.")); err != nil {
|
||||
return nil, fmt.Errorf("error creating azure host plugin: %w", err)
|
||||
}
|
||||
if _, err := conf.CreateHostPlugin(ctx, "aws", &awsplg.AwsPlugin{}, hostplugin.WithDescription("Boundary provided host plugin for AWS.")); err != nil {
|
||||
return nil, fmt.Errorf("error creating aws host plugin: %w", err)
|
||||
}
|
||||
if conf.HostPlugins == nil {
|
||||
conf.HostPlugins = make(map[string]plugin.HostPluginServiceServer)
|
||||
}
|
||||
@@ -140,8 +149,8 @@ func New(ctx context.Context, conf *Config) (*Controller, error) {
|
||||
c.StaticHostRepoFn = func() (*static.Repository, error) {
|
||||
return static.NewRepository(dbase, dbase, c.kms)
|
||||
}
|
||||
c.PluginHostRepoFn = func() (*hostplugin.Repository, error) {
|
||||
return hostplugin.NewRepository(dbase, dbase, c.kms, c.conf.HostPlugins)
|
||||
c.PluginHostRepoFn = func() (*pluginhost.Repository, error) {
|
||||
return pluginhost.NewRepository(dbase, dbase, c.kms, c.conf.HostPlugins)
|
||||
}
|
||||
c.HostPluginRepoFn = func() (*host.Repository, error) {
|
||||
return host.NewRepository(dbase, dbase, c.kms)
|
||||
|
||||
Reference in new issue
Block a user