diff --git a/cmd/containerd/command/config.go b/cmd/containerd/command/config.go index 0e08f5afa..84e418e95 100644 --- a/cmd/containerd/command/config.go +++ b/cmd/containerd/command/config.go @@ -123,6 +123,28 @@ var configCommand = cli.Command{ } } + plugins, err := server.LoadPlugins(ctx, config) + if err != nil { + return err + } + if len(plugins) != 0 { + if config.Plugins == nil { + config.Plugins = make(map[string]interface{}) + } + for _, p := range plugins { + if p.Config == nil { + continue + } + + pc, err := config.Decode(ctx, p.URI(), p.Config) + if err != nil { + return err + } + + config.Plugins[p.URI()] = pc + } + } + config.Version = srvconfig.CurrentConfigVersion return toml.NewEncoder(os.Stdout).SetIndentTables(true).Encode(config)