Add configurable plugin path
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
341b99d6e2
commit
559dfa59a1
@ -28,6 +28,8 @@ type Config struct {
|
||||
Root string `toml:"root"`
|
||||
// State is the path to a directory where containerd will store transient data
|
||||
State string `toml:"state"`
|
||||
// PluginDir is the directory for dynamic plugins to be stored
|
||||
PluginDir string `toml:"plugin_dir"`
|
||||
// GRPC configuration settings
|
||||
GRPC GRPCConfig `toml:"grpc"`
|
||||
// Debug and profiling settings
|
||||
|
@ -220,7 +220,11 @@ func (s *Server) Stop() {
|
||||
// of all plugins.
|
||||
func LoadPlugins(ctx context.Context, config *srvconfig.Config) ([]*plugin.Registration, error) {
|
||||
// load all plugins into containerd
|
||||
if err := plugin.Load(filepath.Join(config.Root, "plugins")); err != nil {
|
||||
path := config.PluginDir
|
||||
if path == "" {
|
||||
path = filepath.Join(config.Root, "plugins")
|
||||
}
|
||||
if err := plugin.Load(path); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// load additional plugins that don't automatically register themselves
|
||||
|
Loading…
Reference in New Issue
Block a user