daemon: rename containerdCli to containerdClient
The containerdCli was somewhat confusing (is it the CLI?); let's rename to make it match what it is :) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
0c6b616656
commit
034e7e153f
7 changed files with 15 additions and 15 deletions
|
@ -110,7 +110,7 @@ type Daemon struct {
|
|||
PluginStore *plugin.Store // TODO: remove
|
||||
pluginManager *plugin.Manager
|
||||
linkIndex *linkIndex
|
||||
containerdCli *containerd.Client
|
||||
containerdClient *containerd.Client
|
||||
containerd libcontainerdtypes.Client
|
||||
defaultIsolation containertypes.Isolation // Default isolation mode on Windows
|
||||
clusterProvider cluster.Provider
|
||||
|
@ -944,7 +944,7 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
|
|||
}
|
||||
|
||||
if configStore.ContainerdAddr != "" {
|
||||
d.containerdCli, err = containerd.New(configStore.ContainerdAddr, containerd.WithDefaultNamespace(configStore.ContainerdNamespace), containerd.WithDialOpts(gopts), containerd.WithTimeout(60*time.Second))
|
||||
d.containerdClient, err = containerd.New(configStore.ContainerdAddr, containerd.WithDefaultNamespace(configStore.ContainerdNamespace), containerd.WithDialOpts(gopts), containerd.WithTimeout(60*time.Second))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to dial %q", configStore.ContainerdAddr)
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
|
|||
return nil, err
|
||||
}
|
||||
d.imageService = ctrd.NewService(ctrd.ImageServiceConfig{
|
||||
Client: d.containerdCli,
|
||||
Client: d.containerdClient,
|
||||
Containers: d.containers,
|
||||
Snapshotter: driverName,
|
||||
RegistryHosts: d.RegistryHosts,
|
||||
|
@ -1137,9 +1137,9 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S
|
|||
// containerd is not currently supported with Windows.
|
||||
// So sometimes d.containerdCli will be nil
|
||||
// In that case we'll create a local content store... but otherwise we'll use containerd
|
||||
if d.containerdCli != nil {
|
||||
imgSvcConfig.Leases = d.containerdCli.LeasesService()
|
||||
imgSvcConfig.ContentStore = d.containerdCli.ContentStore()
|
||||
if d.containerdClient != nil {
|
||||
imgSvcConfig.Leases = d.containerdClient.LeasesService()
|
||||
imgSvcConfig.ContentStore = d.containerdClient.ContentStore()
|
||||
} else {
|
||||
cs, lm, err := d.configureLocalContentStore(config.ContainerdNamespace)
|
||||
if err != nil {
|
||||
|
@ -1316,8 +1316,8 @@ func (daemon *Daemon) Shutdown(ctx context.Context) error {
|
|||
daemon.netController.Stop()
|
||||
}
|
||||
|
||||
if daemon.containerdCli != nil {
|
||||
daemon.containerdCli.Close()
|
||||
if daemon.containerdClient != nil {
|
||||
daemon.containerdClient.Close()
|
||||
}
|
||||
|
||||
if daemon.mdDB != nil {
|
||||
|
|
|
@ -1493,7 +1493,7 @@ func (daemon *Daemon) initLibcontainerd(ctx context.Context, cfg *config.Config)
|
|||
var err error
|
||||
daemon.containerd, err = remote.NewClient(
|
||||
ctx,
|
||||
daemon.containerdCli,
|
||||
daemon.containerdClient,
|
||||
filepath.Join(cfg.ExecRoot, "containerd"),
|
||||
cfg.ContainerdNamespace,
|
||||
daemon,
|
||||
|
|
|
@ -576,7 +576,7 @@ func (daemon *Daemon) initLibcontainerd(ctx context.Context, cfg *config.Config)
|
|||
case windowsV1RuntimeName:
|
||||
daemon.containerd, err = local.NewClient(
|
||||
ctx,
|
||||
daemon.containerdCli,
|
||||
daemon.containerdClient,
|
||||
filepath.Join(cfg.ExecRoot, "containerd"),
|
||||
cfg.ContainerdNamespace,
|
||||
daemon,
|
||||
|
@ -587,7 +587,7 @@ func (daemon *Daemon) initLibcontainerd(ctx context.Context, cfg *config.Config)
|
|||
}
|
||||
daemon.containerd, err = remote.NewClient(
|
||||
ctx,
|
||||
daemon.containerdCli,
|
||||
daemon.containerdClient,
|
||||
filepath.Join(cfg.ExecRoot, "containerd"),
|
||||
cfg.ContainerdNamespace,
|
||||
daemon,
|
||||
|
|
|
@ -144,7 +144,7 @@ func (daemon *Daemon) cleanupContainer(container *container.Container, config ty
|
|||
container.RWLayer = nil
|
||||
} else {
|
||||
if daemon.UsesSnapshotter() {
|
||||
ls := daemon.containerdCli.LeasesService()
|
||||
ls := daemon.containerdClient.LeasesService()
|
||||
lease := leases.Lease{
|
||||
ID: container.ID,
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ func (daemon *Daemon) ContainerExecStart(ctx context.Context, name string, optio
|
|||
|
||||
p := &specs.Process{}
|
||||
if runtime.GOOS != "windows" {
|
||||
ctr, err := daemon.containerdCli.LoadContainer(ctx, ec.Container.ID)
|
||||
ctr, err := daemon.containerdClient.LoadContainer(ctx, ec.Container.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ func (daemon *Daemon) execSetPlatformOpt(ctx context.Context, daemonCfg *config.
|
|||
if len(ec.User) > 0 {
|
||||
var err error
|
||||
if daemon.UsesSnapshotter() {
|
||||
p.User, err = getUserFromContainerd(ctx, daemon.containerdCli, ec)
|
||||
p.User, err = getUserFromContainerd(ctx, daemon.containerdClient, ec)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1116,7 +1116,7 @@ func (daemon *Daemon) createSpec(ctx context.Context, daemonCfg *configStore, c
|
|||
snapshotKey = c.ID
|
||||
}
|
||||
|
||||
return &s, coci.ApplyOpts(ctx, daemon.containerdCli, &containers.Container{
|
||||
return &s, coci.ApplyOpts(ctx, daemon.containerdClient, &containers.Container{
|
||||
ID: c.ID,
|
||||
Snapshotter: snapshotter,
|
||||
SnapshotKey: snapshotKey,
|
||||
|
|
Loading…
Add table
Reference in a new issue