fix(host/plugin): Remove dead code and duplicate imports

pull/3074/head
Hugo 3 years ago
parent e467cbbfa2
commit 5926dc40ba

@ -90,7 +90,6 @@ func (r *OrphanedHostCleanupJob) Run(ctx context.Context) error {
// NextRunIn returns the default run frequency of the cleanup job.
func (r *OrphanedHostCleanupJob) NextRunIn(_ context.Context) (time.Duration, error) {
const op = "plugin.(OrphanedHostCleanupJob).NextRunIn"
return orphanedHostCleanupJobRunInterval, nil
}

@ -20,7 +20,6 @@ import (
"github.com/hashicorp/boundary/internal/kms"
"github.com/hashicorp/boundary/internal/libs/patchstruct"
"github.com/hashicorp/boundary/internal/oplog"
hostplg "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"
@ -41,8 +40,8 @@ func TestRepository_CreateCatalog(t *testing.T) {
wrapper := db.TestWrapper(t)
sched := scheduler.TestScheduler(t, conn, wrapper)
_, prj := iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
plg := hostplg.TestPlugin(t, conn, "test")
unimplementedPlugin := hostplg.TestPlugin(t, conn, "unimplemented")
plg := hostplugin.TestPlugin(t, conn, "test")
unimplementedPlugin := hostplugin.TestPlugin(t, conn, "unimplemented")
const normalizeToSliceKey = "normalize_to_slice"
@ -495,7 +494,7 @@ func TestRepository_UpdateCatalog(t *testing.T) {
var setRespSecretsNil bool
var gotOnUpdateCatalogRequest *plgpb.OnUpdateCatalogRequest
var pluginError error
testPlugin := hostplg.TestPlugin(t, dbConn, "test")
testPlugin := hostplugin.TestPlugin(t, dbConn, "test")
testPluginMap := map[string]plgpb.HostPluginServiceClient{
testPlugin.GetPublicId(): &WrappingPluginClient{
Server: &TestPluginServer{
@ -1263,7 +1262,7 @@ func TestRepository_LookupCatalog(t *testing.T) {
wrapper := db.TestWrapper(t)
sched := scheduler.TestScheduler(t, conn, wrapper)
_, prj := iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
plg := hostplg.TestPlugin(t, conn, "test")
plg := hostplugin.TestPlugin(t, conn, "test")
plgm := map[string]plgpb.HostPluginServiceClient{
plg.GetPublicId(): &WrappingPluginClient{Server: &TestPluginServer{}},
}
@ -1330,7 +1329,7 @@ func TestRepository_ListCatalogs_Multiple_Scopes(t *testing.T) {
rw := db.New(conn)
kms := kms.TestKms(t, conn, wrapper)
sched := scheduler.TestScheduler(t, conn, wrapper)
plg := hostplg.TestPlugin(t, conn, "test")
plg := hostplugin.TestPlugin(t, conn, "test")
plgm := map[string]plgpb.HostPluginServiceClient{
plg.GetPublicId(): &WrappingPluginClient{Server: &TestPluginServer{}},
}
@ -1363,7 +1362,7 @@ func TestRepository_DeleteCatalog(t *testing.T) {
wrapper := db.TestWrapper(t)
sched := scheduler.TestScheduler(t, conn, wrapper)
_, prj := iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
plg := hostplg.TestPlugin(t, conn, "test")
plg := hostplugin.TestPlugin(t, conn, "test")
pluginInstance := &TestPluginServer{}
plgm := map[string]plgpb.HostPluginServiceClient{
plg.GetPublicId(): &WrappingPluginClient{Server: pluginInstance},
@ -1449,7 +1448,7 @@ func TestRepository_DeleteCatalogX(t *testing.T) {
wrapper := db.TestWrapper(t)
sched := scheduler.TestScheduler(t, conn, wrapper)
_, prj := iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
plg := hostplg.TestPlugin(t, conn, "test")
plg := hostplugin.TestPlugin(t, conn, "test")
plgm := map[string]plgpb.HostPluginServiceClient{
plg.GetPublicId(): &WrappingPluginClient{Server: &TestPluginServer{}},
}
@ -1537,7 +1536,7 @@ func TestRepository_UpdateCatalog_SyncSets(t *testing.T) {
dbKmsCache := kms.TestKms(t, dbConn, dbWrapper)
_, projectScope := iam.TestScopes(t, iam.TestRepo(t, dbConn, dbWrapper))
testPlugin := hostplg.TestPlugin(t, dbConn, "test")
testPlugin := hostplugin.TestPlugin(t, dbConn, "test")
dummyPluginMap := map[string]plgpb.HostPluginServiceClient{
testPlugin.GetPublicId(): &WrappingPluginClient{Server: &plgpb.UnimplementedHostPluginServiceServer{}},
}

Loading…
Cancel
Save