Plugins: Make it possible to support multiple plugin versions (#82116)

* first pass

* use version in more places

* add comment

* update installer

* fix wire

* fix tests

* tidy

* simplify changes

* fix in mem

* remove unused step

* fix step dupe logic for child plugins + add tests
This commit is contained in:
Will Browne
2024-02-12 12:47:49 +01:00
committed by GitHub
parent 730e1d2485
commit 788b9afda3
24 changed files with 292 additions and 131 deletions
@@ -18,6 +18,7 @@ var _ Store = (*Service)(nil)
// Store is the publicly accessible storage for plugins.
type Store interface {
// Plugin finds a plugin by its ID.
// Note: version is not required since Grafana only supports single versions of a plugin.
Plugin(ctx context.Context, pluginID string) (Plugin, bool)
// Plugins returns plugins by their requested type.
Plugins(ctx context.Context, pluginTypes ...plugins.Type) []Plugin
@@ -104,7 +105,7 @@ func (s *Service) SecretsManager(ctx context.Context) *plugins.Plugin {
// plugin finds a plugin with `pluginID` from the registry that is not decommissioned
func (s *Service) plugin(ctx context.Context, pluginID string) (*plugins.Plugin, bool) {
p, exists := s.pluginRegistry.Plugin(ctx, pluginID)
p, exists := s.pluginRegistry.Plugin(ctx, pluginID, "") // version is not required since Grafana only supports single versions of a plugin
if !exists {
return nil, false
}