mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CLI: Allow installing custom binary plugins (#17551)
Make sure all data is sent to API to be able to select correct archive version.
This commit is contained in:
@@ -2,24 +2,26 @@ package commands
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
|
||||
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
|
||||
"github.com/grafana/grafana/pkg/cmd/grafana-cli/utils"
|
||||
)
|
||||
|
||||
func listremoteCommand(c utils.CommandLine) error {
|
||||
plugin, err := s.ListAllPlugins(c.RepoDirectory())
|
||||
// listRemoteCommand prints out all plugins in the remote repo with latest version supported on current platform.
|
||||
// If there are no supported versions for plugin it is skipped.
|
||||
func listRemoteCommand(c utils.CommandLine) error {
|
||||
plugin, err := c.ApiClient().ListAllPlugins(c.RepoDirectory())
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, i := range plugin.Plugins {
|
||||
pluginVersion := ""
|
||||
if len(i.Versions) > 0 {
|
||||
pluginVersion = i.Versions[0].Version
|
||||
for _, plugin := range plugin.Plugins {
|
||||
if len(plugin.Versions) > 0 {
|
||||
ver := latestSupportedVersion(&plugin)
|
||||
if ver != nil {
|
||||
logger.Infof("id: %v version: %s\n", plugin.Id, ver.Version)
|
||||
}
|
||||
}
|
||||
|
||||
logger.Infof("id: %v version: %s\n", i.Id, pluginVersion)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user