Skip to content

Commit bc8a189

Browse files
authored
Merge pull request containerd#3155 from crosbymichael/plugins
Add configurable plugin path
2 parents 932f883 + 559dfa5 commit bc8a189

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

services/server/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ type Config struct {
2828
Root string `toml:"root"`
2929
// State is the path to a directory where containerd will store transient data
3030
State string `toml:"state"`
31+
// PluginDir is the directory for dynamic plugins to be stored
32+
PluginDir string `toml:"plugin_dir"`
3133
// GRPC configuration settings
3234
GRPC GRPCConfig `toml:"grpc"`
3335
// Debug and profiling settings

services/server/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ func (s *Server) Stop() {
220220
// of all plugins.
221221
func LoadPlugins(ctx context.Context, config *srvconfig.Config) ([]*plugin.Registration, error) {
222222
// load all plugins into containerd
223-
if err := plugin.Load(filepath.Join(config.Root, "plugins")); err != nil {
223+
path := config.PluginDir
224+
if path == "" {
225+
path = filepath.Join(config.Root, "plugins")
226+
}
227+
if err := plugin.Load(path); err != nil {
224228
return nil, err
225229
}
226230
// load additional plugins that don't automatically register themselves

0 commit comments

Comments
 (0)