From 8e685f78cf66e2901b2fbed2fdddd64449a74ab9 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 19 Feb 2020 01:46:16 +0900 Subject: [PATCH] support building with BUILDTAGS="no_zfs no_aufs" These plugins do not always need to be built-in. Signed-off-by: Akihiro Suda --- cmd/containerd/builtins_aufs_linux.go | 21 +++++++++++++++++++++ cmd/containerd/builtins_linux.go | 2 -- cmd/containerd/builtins_zfs_linux.go | 21 +++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 cmd/containerd/builtins_aufs_linux.go create mode 100644 cmd/containerd/builtins_zfs_linux.go diff --git a/cmd/containerd/builtins_aufs_linux.go b/cmd/containerd/builtins_aufs_linux.go new file mode 100644 index 000000000..6de592a2d --- /dev/null +++ b/cmd/containerd/builtins_aufs_linux.go @@ -0,0 +1,21 @@ +// +build !no_aufs + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package main + +import _ "github.com/containerd/aufs" diff --git a/cmd/containerd/builtins_linux.go b/cmd/containerd/builtins_linux.go index c0ec22448..5fa9a911c 100644 --- a/cmd/containerd/builtins_linux.go +++ b/cmd/containerd/builtins_linux.go @@ -17,7 +17,6 @@ package main import ( - _ "github.com/containerd/aufs" _ "github.com/containerd/containerd/metrics/cgroups" _ "github.com/containerd/containerd/metrics/cgroups/v2" _ "github.com/containerd/containerd/runtime/v1/linux" @@ -25,5 +24,4 @@ import ( _ "github.com/containerd/containerd/runtime/v2/runc/options" _ "github.com/containerd/containerd/snapshots/native" _ "github.com/containerd/containerd/snapshots/overlay" - _ "github.com/containerd/zfs" ) diff --git a/cmd/containerd/builtins_zfs_linux.go b/cmd/containerd/builtins_zfs_linux.go new file mode 100644 index 000000000..b1d161117 --- /dev/null +++ b/cmd/containerd/builtins_zfs_linux.go @@ -0,0 +1,21 @@ +// +build !no_zfs + +/* + Copyright The containerd Authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package main + +import _ "github.com/containerd/zfs"