Plugins: Markdown fetch retry with lowercase (#65384)

* retry with lowercase

* undo incorrect err check

* re-add defer to close file

* fix test
This commit is contained in:
Will Browne
2023-03-27 17:44:06 +01:00
committed by GitHub
parent a37a80bc56
commit 1387fec51d
3 changed files with 155 additions and 8 deletions

View File

@@ -358,7 +358,7 @@ func (f *FakeRoleRegistry) DeclarePluginRoles(_ context.Context, _ string, _ str
}
type FakePluginFiles struct {
FS fs.FS
OpenFunc func(name string) (fs.File, error)
base string
}
@@ -370,7 +370,10 @@ func NewFakePluginFiles(base string) *FakePluginFiles {
}
func (f *FakePluginFiles) Open(name string) (fs.File, error) {
return f.FS.Open(name)
if f.OpenFunc != nil {
return f.OpenFunc(name)
}
return nil, nil
}
func (f *FakePluginFiles) Base() string {