Skip to content

Commit a00c47f

Browse files
committed
plugin: remove go < 1.8 stub, enable on windows and arm64
- we don't support go < 1.8. this restriction as added because plugin support requires go 1.8 or up, but with such old versions being EOL, this check was rather redundant - add back arm64 support; in 0b76334, non-amd64 was disabled, pending golang/go#17138, which was tracking arm64 support, and is now resolved. It's unclear if architectures other than amd64 and arm64 are supported, so keeping it restricted to amd64 and arm64. - enable plugin support on Windows; it was disabled in 69ee7f8 but the code looks to take windows into account. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 24eea01 commit a00c47f

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

plugin.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ var register = struct {
138138
r []*Registration
139139
}{}
140140

141-
// Load loads all plugins at the provided path into containerd
141+
// Load loads all plugins at the provided path into containerd.
142+
//
143+
// Load is currently only implemented on non-static, non-gccgo builds for amd64
144+
// and arm64, and plugins must be built with the exact same version of Go as
145+
// containerd itself.
142146
func Load(path string) (err error) {
143147
defer func() {
144148
if v := recover(); v != nil {

plugin_go18.go renamed to plugin_supported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build go1.8 && !windows && amd64 && !static_build && !gccgo
1+
//go:build (amd64 || arm64) && !static_build && !gccgo
22

33
/*
44
Copyright The containerd Authors.

plugin_other.go renamed to plugin_unsupported.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !go1.8 || windows || !amd64 || static_build || gccgo
1+
//go:build (!amd64 && !arm64) || static_build || gccgo
22

33
/*
44
Copyright The containerd Authors.
@@ -18,7 +18,11 @@
1818

1919
package plugin
2020

21+
// loadPlugins is not supported;
22+
//
23+
// - with gccgo: gccgo has no plugin support golang/go#36403
24+
// - on static builds; https://github.com/containerd/containerd/commit/0d682e24a1ba8e93e5e54a73d64f7d256f87492f
25+
// - on architectures other than amd64 and arm64 (other architectures need to be tested)
2126
func loadPlugins(path string) error {
22-
// plugins not supported until 1.8
2327
return nil
2428
}

0 commit comments

Comments
 (0)