diff --git a/plugin/plugin.go b/plugin/plugin.go index d1b94ac44..45fc22c98 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -138,7 +138,11 @@ var register = struct { r []*Registration }{} -// Load loads all plugins at the provided path into containerd +// Load loads all plugins at the provided path into containerd. +// +// Load is currently only implemented on non-static, non-gccgo builds for amd64 +// and arm64, and plugins must be built with the exact same version of Go as +// containerd itself. func Load(path string) (err error) { defer func() { if v := recover(); v != nil { diff --git a/plugin/plugin_go18.go b/plugin/plugin_supported.go similarity index 95% rename from plugin/plugin_go18.go rename to plugin/plugin_supported.go index 0ee442d95..0eaf47064 100644 --- a/plugin/plugin_go18.go +++ b/plugin/plugin_supported.go @@ -1,4 +1,4 @@ -//go:build go1.8 && !windows && amd64 && !static_build && !gccgo +//go:build (amd64 || arm64) && !static_build && !gccgo /* Copyright The containerd Authors. diff --git a/plugin/plugin_other.go b/plugin/plugin_unsupported.go similarity index 65% rename from plugin/plugin_other.go rename to plugin/plugin_unsupported.go index c0b53a6b4..b250be357 100644 --- a/plugin/plugin_other.go +++ b/plugin/plugin_unsupported.go @@ -1,4 +1,4 @@ -//go:build !go1.8 || windows || !amd64 || static_build || gccgo +//go:build (!amd64 && !arm64) || static_build || gccgo /* Copyright The containerd Authors. @@ -18,7 +18,11 @@ package plugin +// loadPlugins is not supported; +// +// - with gccgo: gccgo has no plugin support golang/go#36403 +// - on static builds; https://github.com/containerd/containerd/commit/0d682e24a1ba8e93e5e54a73d64f7d256f87492f +// - on architectures other than amd64 and arm64 (other architectures need to be tested) func loadPlugins(path string) error { - // plugins not supported until 1.8 return nil }