Backend Plugins: Plugin configuration using Grafana config (#23451)
Enables adding a section `plugin.<plugin id>` and key/value to Grafana configuration file which will be converted and sent as environment variables to the backend plugin. Also sends some additional environment variables, Grafana version (GF_VERSION), Grafana edition (GF_EDITION) and enterprise license path (GF_ENTERPRISE_LICENSE_PATH). Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Fixes #21515,
This commit is contained in:
co-authored by
Arve Knudsen
parent
941cd59894
commit
34266cd369
@@ -30,9 +30,12 @@ var handshake = goplugin.HandshakeConfig{
|
||||
MagicCookieValue: grpcplugin.MagicCookieValue,
|
||||
}
|
||||
|
||||
func newClientConfig(executablePath string, logger log.Logger, versionedPlugins map[int]goplugin.PluginSet) *goplugin.ClientConfig {
|
||||
func newClientConfig(executablePath string, env []string, logger log.Logger, versionedPlugins map[int]goplugin.PluginSet) *goplugin.ClientConfig {
|
||||
cmd := exec.Command(executablePath)
|
||||
cmd.Env = env
|
||||
|
||||
return &goplugin.ClientConfig{
|
||||
Cmd: exec.Command(executablePath),
|
||||
Cmd: cmd,
|
||||
HandshakeConfig: handshake,
|
||||
VersionedPlugins: versionedPlugins,
|
||||
Logger: logWrapper{Logger: logger},
|
||||
|
||||
Reference in New Issue
Block a user