@@ -55,6 +55,7 @@ import (
5555 "github.com/containerd/containerd/defaults"
5656 "github.com/containerd/containerd/diff"
5757 diffproxy "github.com/containerd/containerd/diff/proxy"
58+ "github.com/containerd/containerd/pkg/deprecation"
5859 "github.com/containerd/containerd/pkg/dialer"
5960 "github.com/containerd/containerd/pkg/timeout"
6061 "github.com/containerd/containerd/platforms"
@@ -356,7 +357,9 @@ func recordConfigDeprecations(ctx context.Context, config *srvconfig.Config, set
356357 return
357358 }
358359
359- _ = warn // TODO(samuelkarp): placeholder for future use
360+ if config .PluginDir != "" { //nolint:staticcheck
361+ warn .Emit (ctx , deprecation .GoPluginLibrary )
362+ }
360363}
361364
362365// Server is the containerd main daemon
@@ -459,13 +462,15 @@ func (s *Server) Wait() {
459462// of all plugins.
460463func LoadPlugins (ctx context.Context , config * srvconfig.Config ) ([]plugin.Registration , error ) {
461464 // load all plugins into containerd
462- path := config .PluginDir // nolint: staticcheck
465+ path := config .PluginDir //nolint:staticcheck
463466 if path == "" {
464467 path = filepath .Join (config .Root , "plugins" )
465468 }
466- log .G (ctx ).Warning ("`go_plugin` is deprecated, please use `external plugins` instead" )
467- if err := dynamic .Load (path ); err != nil {
469+ if count , err := dynamic .Load (path ); err != nil {
468470 return nil , err
471+ } else if count > 0 || config .PluginDir != "" { //nolint:staticcheck
472+ config .PluginDir = path //nolint:staticcheck
473+ log .G (ctx ).Warningf ("loaded %d dynamic plugins. `go_plugin` is deprecated, please use `external plugins` instead" , count )
469474 }
470475 // load additional plugins that don't automatically register themselves
471476 registry .Register (& plugin.Registration {
0 commit comments