enhance: split config from server package

The github.com/containerd/containerd/services/server has a lot of
dependencies, like content, snapshots services implementation and
docker-metrics.

For the client side, it uses the config struct from server package
to start up the containerd in background. It will import a lot of
useless packages which might be conflict with existing vendor's package.

It makes integration easier with single config package.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu
2018-10-17 11:58:33 +08:00
parent 483724b0df
commit 06616dab00
13 changed files with 46 additions and 31 deletions

View File

@@ -30,7 +30,7 @@ import (
"github.com/containerd/containerd/oci"
"github.com/containerd/containerd/pkg/testutil"
"github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/containerd/services/server"
srvconfig "github.com/containerd/containerd/services/server/config"
)
// the following nolint is for shutting up gometalinter on non-linux.
@@ -42,7 +42,7 @@ func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, fun
testutil.RequiresRoot(t)
var (
ctrd = daemon{}
configTOMLDecoded server.Config
configTOMLDecoded srvconfig.Config
buf = bytes.NewBuffer(nil)
)
@@ -61,7 +61,7 @@ func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, fun
t.Fatal(err)
}
if err = server.LoadConfig(configTOMLFile, &configTOMLDecoded); err != nil {
if err = srvconfig.LoadConfig(configTOMLFile, &configTOMLDecoded); err != nil {
t.Fatal(err)
}