Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

plugins - automatically reload/remove Go plugins #2818

Merged
merged 3 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/unreleased/178-wwitzel3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat(plugins): allow automatic reloading of Go plugins
6 changes: 5 additions & 1 deletion internal/api/content_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ func (cm *ContentManager) generateContent(ctx context.Context, state octant.Stat

m, ok := cm.moduleManager.ModuleForContentPath(contentPath)
if !ok {
return emptyContent, false, fmt.Errorf("unable to find module for content path %q", contentPath)
content := Content{
Response: notFoundPage(contentPath),
Path: contentPath,
}
return content, false, nil
}
modulePath := strings.TrimPrefix(contentPath, m.Name())
options := module.ContentOptions{
Expand Down
2 changes: 1 addition & 1 deletion pkg/dash/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func initPlugin(moduleManager module.ManagerInterface, actionManager *action.Man
if plugin.IsJavaScriptPlugin(pluginPath) {
continue
}
if err := m.Load(pluginPath); err != nil {
if _, err := m.Load(pluginPath); err != nil {
return nil, fmt.Errorf("initialize plugin %q: %w", pluginPath, err)
}

Expand Down
42 changes: 42 additions & 0 deletions pkg/plugin/fake/fakes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading