Plugins: Replace CDN class with FS CDN type (#113968)
replace cdn class with fs type
This commit is contained in:
@@ -36,7 +36,7 @@ func NewPatternListInspector(detectorsProvider angulardetector.DetectorsProvider
|
||||
|
||||
func (i *PatternsListInspector) Inspect(ctx context.Context, p *plugins.Plugin) (isAngular bool, err error) {
|
||||
// CDN plugins are ignored because they should not be using Angular
|
||||
if p.Class == plugins.ClassCDN {
|
||||
if p.FS.Type().CDN() {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/loader/angular/angulardetector"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/pluginfakes"
|
||||
)
|
||||
|
||||
type fakeDetector struct {
|
||||
@@ -81,7 +82,11 @@ func TestPatternsListInspector(t *testing.T) {
|
||||
{
|
||||
name: "CDN plugins return false without calling detectors",
|
||||
plugin: &plugins.Plugin{
|
||||
Class: plugins.ClassCDN,
|
||||
FS: &pluginfakes.FakePluginFS{
|
||||
TypeFunc: func() plugins.FSType {
|
||||
return plugins.FSTypeCDN
|
||||
},
|
||||
},
|
||||
},
|
||||
fakeDetectors: []*fakeDetector{
|
||||
{returns: true},
|
||||
|
||||
Reference in New Issue
Block a user