docs: fix usage of cio package in docs

Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
Ace-Tang 2017-12-05 00:07:08 +08:00
parent fe4e30cbb7
commit aca8e15916
2 changed files with 5 additions and 5 deletions

View File

@ -133,7 +133,7 @@ Taking a container object and turning it into a runnable process on a system is
```go ```go
// create a new task // create a new task
task, err := redis.NewTask(context, containerd.Stdio) task, err := redis.NewTask(context, cio.Stdio)
defer task.Delete(context) defer task.Delete(context)
// the task is now running and has a pid that can be use to setup networking // the task is now running and has a pid that can be use to setup networking
@ -165,7 +165,7 @@ checkpoint := image.Target()
redis, err = client.NewContainer(context, "redis-master", containerd.WithCheckpoint(checkpoint, "redis-rootfs")) redis, err = client.NewContainer(context, "redis-master", containerd.WithCheckpoint(checkpoint, "redis-rootfs"))
defer container.Delete(context) defer container.Delete(context)
task, err = redis.NewTask(context, containerd.Stdio, containerd.WithTaskCheckpoint(checkpoint)) task, err = redis.NewTask(context, cio.Stdio, containerd.WithTaskCheckpoint(checkpoint))
defer task.Delete(context) defer task.Delete(context)
err := task.Start(context) err := task.Start(context)

View File

@ -231,7 +231,7 @@ A task is a live, running process on the system.
Tasks should be deleted after each run while a container can be used, updated, and queried multiple times. Tasks should be deleted after each run while a container can be used, updated, and queried multiple times.
```go ```go
task, err := container.NewTask(ctx, containerd.Stdio) task, err := container.NewTask(ctx, cio.Stdio)
if err != nil { if err != nil {
return err return err
} }
@ -239,7 +239,7 @@ Tasks should be deleted after each run while a container can be used, updated, a
``` ```
The new task that we just created is actually a running process on your system. The new task that we just created is actually a running process on your system.
We use the `containerd.Stdio` `Opt` so that all IO from the container is sent to our `main.go` process. We use the `cio.Stdio` `Opt` so that all IO from the container is sent to our `main.go` process.
If you are familiar with the OCI runtime actions, the task is currently in the "created" state. If you are familiar with the OCI runtime actions, the task is currently in the "created" state.
This means that the namespaces, root filesystem, and various container level settings have been initialized but the user defined process, in this example "redis-server", has not been started. This means that the namespaces, root filesystem, and various container level settings have been initialized but the user defined process, in this example "redis-server", has not been started.
@ -359,7 +359,7 @@ func redisExample() error {
defer container.Delete(ctx, containerd.WithSnapshotCleanup) defer container.Delete(ctx, containerd.WithSnapshotCleanup)
// create a task from the container // create a task from the container
task, err := container.NewTask(ctx, containerd.Stdio) task, err := container.NewTask(ctx, cio.Stdio)
if err != nil { if err != nil {
return err return err
} }