Skip to content

Commit 95be56c

Browse files
committed
refactor plugin startup - bootstrap rate limiter table from plugin manager startup
1 parent f9e9d07 commit 95be56c

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/hashicorp/go-version v1.6.0 // indirect
1010
github.com/turbot/go-kit v0.8.0-rc.0
1111
github.com/turbot/steampipe v0.21.0-alpha.4
12-
github.com/turbot/steampipe-plugin-sdk/v5 v5.6.0-dev.22
12+
github.com/turbot/steampipe-plugin-sdk/v5 v5.6.0-rc.21
1313
go.opentelemetry.io/otel v1.16.0
1414
google.golang.org/protobuf v1.31.0
1515
)
@@ -183,4 +183,6 @@ replace (
183183
github.com/deislabs/oras => github.com/oras-project/oras v0.9.0
184184
github.com/docker/distribution => github.com/distribution/distribution v2.7.1+incompatible
185185
github.com/docker/docker => github.com/moby/moby v20.10.17+incompatible
186+
github.com/turbot/steampipe => /Users/kai/Dev/github/turbot/steampipe
187+
github.com/turbot/steampipe-plugin-sdk/v5 => /Users/kai/Dev/github/turbot/steampipe-plugin-sdk
186188
)

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1
978978
github.com/tombuildsstuff/giovanni v0.15.1/go.mod h1:0TZugJPEtqzPlMpuJHYfXY6Dq2uLPrXf98D2XQSxNbA=
979979
github.com/turbot/go-kit v0.8.0-rc.0 h1:Vj1w5TmZWwdSwBTcOq6FKVlQQ+XwCd27BZVPZ9m1hT0=
980980
github.com/turbot/go-kit v0.8.0-rc.0/go.mod h1:JkVKhR5XHK86aXY4WzB9Lr0jdnrsafjVh4yJA8ZS3Ck=
981-
github.com/turbot/steampipe v0.21.0-alpha.4 h1:xIzlfycDBux0/ltHeMk7ihFzWHy0oWyTt+YDAFnmRPs=
982-
github.com/turbot/steampipe v0.21.0-alpha.4/go.mod h1:ZFYpAGggT7cVGCXho2BkPpBFyFoNcd+gugjaIwoDzBM=
983-
github.com/turbot/steampipe-plugin-sdk/v5 v5.6.0-dev.22 h1:LFInIEjFtrZH4nrbLOW9MiG0ELlNFEd+2fLJeiEEzec=
984-
github.com/turbot/steampipe-plugin-sdk/v5 v5.6.0-dev.22/go.mod h1:Np0X1Oj3JNTcuf9JmvWwHrCqc0UB4iJLmUlOkRwMCWw=
985981
github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
986982
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
987983
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=

hub/connection_factory.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package hub
22

33
import (
44
"fmt"
5+
"github.com/turbot/steampipe/pkg/pluginmanager"
56
"github.com/turbot/steampipe/pkg/utils"
67
"log"
78
"strings"
@@ -97,7 +98,13 @@ func (f *connectionFactory) createConnectionPlugin(pluginFQN string, connectionN
9798

9899
log.Printf("[TRACE] createConnectionPlugin plugin %s, connection %s, config: %s\n", utils.PluginFQNToSchemaName(pluginFQN), connectionName, connection.Config)
99100

100-
connectionPlugins, res := steampipeconfig.CreateConnectionPlugins([]string{connection.Name})
101+
// get plugin manager
102+
pluginManager, err := pluginmanager.GetPluginManager()
103+
if err != nil {
104+
return nil, err
105+
}
106+
107+
connectionPlugins, res := steampipeconfig.CreateConnectionPlugins(pluginManager, []string{connection.Name})
101108
if res.Error != nil {
102109
return nil, res.Error
103110
}

0 commit comments

Comments
 (0)