فهرست منبع

removes dependencies install for plugins

this features was never intended for production.
bergquist 7 سال پیش
والد
کامیت
47e363ea15
3فایلهای تغییر یافته به همراه3 افزوده شده و 23 حذف شده
  1. 1 8
      pkg/cmd/grafana-cli/commands/install_command.go
  2. 1 2
      pkg/cmd/grafana-cli/models/model.go
  3. 1 13
      pkg/plugins/models.go

+ 1 - 8
pkg/cmd/grafana-cli/commands/install_command.go

@@ -91,14 +91,7 @@ func InstallPlugin(pluginName, version string, c CommandLine) error {
 	}
 
 	logger.Infof("%s Installed %s successfully \n", color.GreenString("✔"), pluginName)
-
-	res, _ := s.ReadPlugin(pluginFolder, pluginName)
-	for _, v := range res.Dependencies.Plugins {
-		InstallPlugin(v.Id, version, c)
-		logger.Infof("Installed dependency: %v ✔\n", v.Id)
-	}
-
-	return err
+	return nil
 }
 
 func SelectVersion(plugin m.Plugin, version string) (m.Version, error) {

+ 1 - 2
pkg/cmd/grafana-cli/models/model.go

@@ -14,8 +14,7 @@ type InstalledPlugin struct {
 }
 
 type Dependencies struct {
-	GrafanaVersion string   `json:"grafanaVersion"`
-	Plugins        []Plugin `json:"plugins"`
+	GrafanaVersion string `json:"grafanaVersion"`
 }
 
 type PluginInfo struct {

+ 1 - 13
pkg/plugins/models.go

@@ -59,10 +59,6 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
 		plog.Info("Registering plugin", "name", pb.Name)
 	}
 
-	if len(pb.Dependencies.Plugins) == 0 {
-		pb.Dependencies.Plugins = []PluginDependencyItem{}
-	}
-
 	if pb.Dependencies.GrafanaVersion == "" {
 		pb.Dependencies.GrafanaVersion = "*"
 	}
@@ -79,8 +75,7 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
 }
 
 type PluginDependencies struct {
-	GrafanaVersion string                 `json:"grafanaVersion"`
-	Plugins        []PluginDependencyItem `json:"plugins"`
+	GrafanaVersion string `json:"grafanaVersion"`
 }
 
 type PluginInclude struct {
@@ -96,13 +91,6 @@ type PluginInclude struct {
 	Id string `json:"-"`
 }
 
-type PluginDependencyItem struct {
-	Type    string `json:"type"`
-	Id      string `json:"id"`
-	Name    string `json:"name"`
-	Version string `json:"version"`
-}
-
 type PluginInfo struct {
 	Author      PluginInfoLink      `json:"author"`
 	Description string              `json:"description"`