Fix: fix loading symbolically linked plugins (#35635) (#35693)

(cherry picked from commit 5b5cb94809)

Co-authored-by: Domas <domas.lapinskas@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-06-15 13:24:53 +03:00
committed by GitHub
co-authored by Domas
parent 9fce4436ea
commit dd24946f0f
3 changed files with 46 additions and 20 deletions
+18
View File
@@ -399,6 +399,24 @@ func TestPluginManager_Init(t *testing.T) {
assert.Equal(t, "Grafana Labs", p.SignatureOrg)
assert.False(t, p.IsCorePlugin)
})
t.Run("With back-end plugin that is symlinked to plugins dir", func(t *testing.T) {
origAppURL := setting.AppUrl
t.Cleanup(func() {
setting.AppUrl = origAppURL
})
setting.AppUrl = defaultAppURL
pm := createManager(t, func(pm *PluginManager) {
pm.Cfg.PluginsPath = "testdata/symbolic-plugin-dirs"
})
err := pm.Init()
require.NoError(t, err)
// This plugin should be properly registered, even though it is symlinked to prlugins dir
require.Empty(t, pm.scanningErrors)
const pluginID = "test"
assert.NotNil(t, pm.plugins[pluginID])
})
}
func TestPluginManager_IsBackendOnlyPlugin(t *testing.T) {
+1
View File
@@ -0,0 +1 @@
../symbolic-file-links/plugin