Add HCL support for defining rate limiters, with filewatching as per connection config. Closes #3746

This commit is contained in:
kaidaguerre
2023-08-11 14:24:44 +01:00
committed by GitHub
parent 6dfd78920e
commit 202cb68692
29 changed files with 552 additions and 178 deletions

View File

@@ -18,7 +18,6 @@ import (
"github.com/turbot/steampipe/pkg/connection"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/constants/runtime"
"github.com/turbot/steampipe/pkg/error_helpers"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/pluginmanager_service"
"github.com/turbot/steampipe/pkg/steampipeconfig"
@@ -65,7 +64,7 @@ func runPluginManagerCmd(cmd *cobra.Command, _ []string) {
configMap := connection.NewConnectionConfigMap(steampipeConfig.Connections)
log.Printf("[TRACE] loaded config map: %s", strings.Join(steampipeConfig.ConnectionNames(), ","))
pluginManager, err := pluginmanager_service.NewPluginManager(configMap, logger)
pluginManager, err := pluginmanager_service.NewPluginManager(ctx, configMap, steampipeConfig.Limiters, logger)
if err != nil {
log.Printf("[WARN] failed to create plugin manager: %s", err.Error())
os.Exit(1)
@@ -73,11 +72,9 @@ func runPluginManagerCmd(cmd *cobra.Command, _ []string) {
if shouldRunConnectionWatcher() {
log.Printf("[INFO] starting connection watcher")
connectionWatcher, err := connection.NewConnectionWatcher(pluginManager.OnConnectionConfigChanged)
if err != nil {
log.Printf("[WARN] failed to create connection watcher: %s", err.Error())
error_helpers.ShowError(ctx, err)
os.Exit(1)
}