mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 21:37:31 -05:00
Licensing: Send the app url to plugin (#64258)
This commit is contained in:
@@ -57,6 +57,7 @@ func (i *Initializer) envVars(plugin *plugins.Plugin) []string {
|
||||
hostEnv,
|
||||
fmt.Sprintf("GF_EDITION=%s", i.license.Edition()),
|
||||
fmt.Sprintf("GF_ENTERPRISE_LICENSE_PATH=%s", i.license.Path()),
|
||||
fmt.Sprintf("GF_ENTERPRISE_APP_URL=%s", i.license.AppURL()),
|
||||
)
|
||||
hostEnv = append(hostEnv, i.license.Environment()...)
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@ func TestInitializer_envVars(t *testing.T) {
|
||||
LicenseEdition: "test",
|
||||
TokenRaw: "token",
|
||||
LicensePath: "/path/to/ent/license",
|
||||
LicenseAppURL: "https://myorg.com/",
|
||||
}
|
||||
|
||||
i := &Initializer{
|
||||
@@ -158,12 +159,13 @@ func TestInitializer_envVars(t *testing.T) {
|
||||
}
|
||||
|
||||
envVars := i.envVars(p)
|
||||
assert.Len(t, envVars, 5)
|
||||
assert.Len(t, envVars, 6)
|
||||
assert.Equal(t, "GF_PLUGIN_CUSTOM_ENV_VAR=customVal", envVars[0])
|
||||
assert.Equal(t, "GF_VERSION=", envVars[1])
|
||||
assert.Equal(t, "GF_EDITION=test", envVars[2])
|
||||
assert.Equal(t, "GF_ENTERPRISE_LICENSE_PATH=/path/to/ent/license", envVars[3])
|
||||
assert.Equal(t, "GF_ENTERPRISE_LICENSE_TEXT=token", envVars[4])
|
||||
assert.Equal(t, "GF_ENTERPRISE_APP_URL=https://myorg.com/", envVars[4])
|
||||
assert.Equal(t, "GF_ENTERPRISE_LICENSE_TEXT=token", envVars[5])
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user