mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 21:52:43 +08:00
feat: pass gcom sso_api_token to repo created from install command (#98973)
* feat: pass gcom sso_api_token to repo created from install command * fix * fix: extract gcom section to a func * Update pkg/cmd/grafana-cli/utils/command_line.go Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com> * fix: only set gcom token when the request is to GCOM --------- Co-authored-by: Giuseppe Guerra <giuseppe.guerra@grafana.com>
This commit is contained in:
@ -90,6 +90,7 @@ type pluginInstallOpts struct {
|
||||
repoURL string
|
||||
pluginURL string
|
||||
pluginDir string
|
||||
gcomToken string
|
||||
}
|
||||
|
||||
func newInstallPluginOpts(c utils.CommandLine) pluginInstallOpts {
|
||||
@ -98,6 +99,7 @@ func newInstallPluginOpts(c utils.CommandLine) pluginInstallOpts {
|
||||
repoURL: c.PluginRepoURL(),
|
||||
pluginURL: c.PluginURL(),
|
||||
pluginDir: c.PluginDirectory(),
|
||||
gcomToken: c.GcomToken(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,9 +134,10 @@ func doInstallPlugin(ctx context.Context, pluginID, version string, o pluginInst
|
||||
}
|
||||
|
||||
repository := repo.NewManager(repo.ManagerCfg{
|
||||
SkipTLSVerify: o.insecure,
|
||||
BaseURL: o.repoURL,
|
||||
Logger: services.Logger,
|
||||
SkipTLSVerify: o.insecure,
|
||||
BaseURL: o.repoURL,
|
||||
Logger: services.Logger,
|
||||
GrafanaComAPIToken: o.gcomToken,
|
||||
})
|
||||
|
||||
// FIXME: Re-enable grafanaVersion. This check was broken in 10.2 so disabling it for the moment.
|
||||
|
Reference in New Issue
Block a user