mirror of
https://github.com/turbot/steampipe.git
synced 2026-01-20 23:01:29 -05:00
22 lines
769 B
Go
22 lines
769 B
Go
package plugin
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/turbot/steampipe/pkg/ociinstaller"
|
|
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
|
|
)
|
|
|
|
// GetInstalledPlugins returns the list of plugins keyed by the shortname (org/name) and its specific version
|
|
// Does not validate/check of available connections
|
|
func GetInstalledPlugins() (map[string]*modconfig.PluginVersionString, error) {
|
|
installedPlugins := make(map[string]*modconfig.PluginVersionString)
|
|
installedPluginsData, _ := List(nil)
|
|
for _, plugin := range installedPluginsData {
|
|
org, name, _ := ociinstaller.NewSteampipeImageRef(plugin.Name).GetOrgNameAndStream()
|
|
pluginShortName := fmt.Sprintf("%s/%s", org, name)
|
|
installedPlugins[pluginShortName] = plugin.Version
|
|
}
|
|
return installedPlugins, nil
|
|
}
|