Merge pull request #1869 from Ace-Tang/cio-docs-fix

docs: fix usage of cio package in docs
This commit is contained in:
Stephen Day 2017-12-04 14:22:04 -08:00 committed by GitHub
commit a6fad51e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
// create a new task
task, err := redis.NewTask(context, containerd.Stdio)
task, err := redis.NewTask(context, cio.Stdio)
defer task.Delete(context)
// 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"))
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)
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.
```go
task, err := container.NewTask(ctx, containerd.Stdio)
task, err := container.NewTask(ctx, cio.Stdio)
if err != nil {
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.
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.
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)
// create a task from the container
task, err := container.NewTask(ctx, containerd.Stdio)
task, err := container.NewTask(ctx, cio.Stdio)
if err != nil {
return err
}