diff --git a/internal/daemon/controller/common/common.go b/internal/daemon/controller/common/common.go index 20744a222..d0b1d9d00 100644 --- a/internal/daemon/controller/common/common.go +++ b/internal/daemon/controller/common/common.go @@ -11,7 +11,6 @@ import ( hostplugin "github.com/hashicorp/boundary/internal/plugin/host" "github.com/hashicorp/boundary/internal/server" "github.com/hashicorp/boundary/internal/session" - "github.com/hashicorp/boundary/internal/target" ) type ( @@ -26,6 +25,5 @@ type ( PluginHostRepoFactory func() (*pluginhost.Repository, error) HostPluginRepoFactory func() (*hostplugin.Repository, error) ConnectionRepoFactory func() (*session.ConnectionRepository, error) - TargetRepoFactory func() (*target.Repository, error) WorkerAuthRepoStorageFactory func() (*server.WorkerAuthRepositoryStorage, error) ) diff --git a/internal/daemon/controller/controller.go b/internal/daemon/controller/controller.go index 01935b3bf..500b2d709 100644 --- a/internal/daemon/controller/controller.go +++ b/internal/daemon/controller/controller.go @@ -115,7 +115,7 @@ type Controller struct { StaticHostRepoFn common.StaticRepoFactory PluginHostRepoFn common.PluginHostRepoFactory HostPluginRepoFn common.HostPluginRepoFactory - TargetRepoFn common.TargetRepoFactory + TargetRepoFn target.RepositoryFactory WorkerAuthRepoStorageFn common.WorkerAuthRepoStorageFactory scheduler *scheduler.Scheduler diff --git a/internal/daemon/controller/handlers/targets/target_service.go b/internal/daemon/controller/handlers/targets/target_service.go index 0b1a3dce7..f5c45dfc2 100644 --- a/internal/daemon/controller/handlers/targets/target_service.go +++ b/internal/daemon/controller/handlers/targets/target_service.go @@ -98,7 +98,7 @@ var ( type Service struct { pbs.UnsafeTargetServiceServer - repoFn common.TargetRepoFactory + repoFn target.RepositoryFactory iamRepoFn common.IamRepoFactory serversRepoFn common.ServersRepoFactory sessionRepoFn session.RepositoryFactory @@ -115,7 +115,7 @@ var _ pbs.TargetServiceServer = (*Service)(nil) func NewService( ctx context.Context, kmsCache *kms.Kms, - repoFn common.TargetRepoFactory, + repoFn target.RepositoryFactory, iamRepoFn common.IamRepoFactory, serversRepoFn common.ServersRepoFactory, sessionRepoFn session.RepositoryFactory, diff --git a/internal/target/repository.go b/internal/target/repository.go index 2f65552f5..874b9de89 100644 --- a/internal/target/repository.go +++ b/internal/target/repository.go @@ -15,6 +15,10 @@ import ( "github.com/hashicorp/go-dbw" ) +// RepositoryFactory enables `target.Repository` object instantiation, +// and is used by the various service packages/controller object to do so. +type RepositoryFactory func() (*Repository, error) + // Cloneable provides a cloning interface type Cloneable interface { Clone() Target