mirror of
https://github.com/containerd/containerd.git
synced 2026-08-03 14:40:45 +00:00
plugins: modernize: any
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -55,7 +55,7 @@ func init() {
|
||||
Requires: []plugin.Type{
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
md, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -52,7 +52,7 @@ func init() {
|
||||
Requires: []plugin.Type{
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
md, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -72,7 +72,7 @@ func init() {
|
||||
Requires: []plugin.Type{
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
if !cimfs.IsBlockCimSupported() {
|
||||
return nil, fmt.Errorf("host OS version doesn't support block CIMs: %w", plugin.ErrSkipPlugin)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func init() {
|
||||
Requires: []plugin.Type{
|
||||
plugins.MetadataPlugin,
|
||||
},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
md, err := ic.GetSingle(plugins.MetadataPlugin)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -140,7 +140,7 @@ func init() {
|
||||
Type: plugins.MountHandlerPlugin,
|
||||
ID: "erofs",
|
||||
Config: &Config{},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
p := platforms.DefaultSpec()
|
||||
p.OS = runtime.GOOS
|
||||
ic.Meta.Platforms = append(ic.Meta.Platforms, p)
|
||||
|
||||
@@ -41,7 +41,7 @@ func init() {
|
||||
ID: "btrfs",
|
||||
Type: plugins.SnapshotPlugin,
|
||||
Config: &Config{},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()}
|
||||
|
||||
config, ok := ic.Config.(*Config)
|
||||
|
||||
@@ -337,7 +337,7 @@ func (m *PoolMetadata) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func putObject(bucket *bolt.Bucket, key string, obj interface{}, overwrite bool) error {
|
||||
func putObject(bucket *bolt.Bucket, key string, obj any, overwrite bool) error {
|
||||
keyBytes := []byte(key)
|
||||
|
||||
if !overwrite && bucket.Get(keyBytes) != nil {
|
||||
@@ -356,7 +356,7 @@ func putObject(bucket *bolt.Bucket, key string, obj interface{}, overwrite bool)
|
||||
return nil
|
||||
}
|
||||
|
||||
func getObject(bucket *bolt.Bucket, key string, obj interface{}) error {
|
||||
func getObject(bucket *bolt.Bucket, key string, obj any) error {
|
||||
data := bucket.Get([]byte(key))
|
||||
if data == nil {
|
||||
return ErrNotFound
|
||||
|
||||
@@ -34,7 +34,7 @@ func init() {
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "devmapper",
|
||||
Config: &devmapper.Config{},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
|
||||
|
||||
config, ok := ic.Config.(*devmapper.Config)
|
||||
|
||||
@@ -50,7 +50,7 @@ func init() {
|
||||
registry.Register(&plugin.Registration{
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "windows-lcow",
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{
|
||||
OS: "linux",
|
||||
Architecture: runtime.GOARCH,
|
||||
|
||||
@@ -56,7 +56,7 @@ func init() {
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "overlayfs",
|
||||
Config: &Config{},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
|
||||
|
||||
config, ok := ic.Config.(*Config)
|
||||
|
||||
@@ -81,7 +81,7 @@ func init() {
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "blockcim",
|
||||
Config: &BlockCIMSnapshotterConfig{},
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()}
|
||||
|
||||
config, ok := ic.Config.(*BlockCIMSnapshotterConfig)
|
||||
|
||||
@@ -108,7 +108,7 @@ func init() {
|
||||
registry.Register(&plugin.Registration{
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "cimfs",
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()}
|
||||
return NewCimFSSnapshotter(ic.Properties[plugins.PropertyRootDir])
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ func init() {
|
||||
registry.Register(&plugin.Registration{
|
||||
Type: plugins.SnapshotPlugin,
|
||||
ID: "windows",
|
||||
InitFn: func(ic *plugin.InitContext) (interface{}, error) {
|
||||
InitFn: func(ic *plugin.InitContext) (any, error) {
|
||||
ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()}
|
||||
return NewWindowsSnapshotter(ic.Properties[plugins.PropertyRootDir])
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user