runtime/opts: move WithNamespaceCgroupDeletion from containerd to its own package

The cgroup dependency brings in quite a lot only for WithNamespaceCgroupDeletion,
which is a namespaces.DeleteOpt.

Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
Tibor Vass 2019-08-20 22:00:48 +00:00
parent d618c80077
commit 6624a70d92
2 changed files with 5 additions and 5 deletions

View File

@ -17,15 +17,15 @@
package namespaces
import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/runtime/opts"
"github.com/urfave/cli"
)
func deleteOpts(context *cli.Context) []namespaces.DeleteOpts {
var opts []namespaces.DeleteOpts
var delOpts []namespaces.DeleteOpts
if context.Bool("cgroup") {
opts = append(opts, containerd.WithNamespaceCgroupDeletion)
delOpts = append(delOpts, opts.WithNamespaceCgroupDeletion)
}
return opts
return delOpts
}

View File

@ -14,7 +14,7 @@
limitations under the License.
*/
package containerd
package opts
import (
"context"