Skip to content

Commit

Permalink
docs: fix usage of cio package in docs
Browse files Browse the repository at this point in the history
Signed-off-by: Ace-Tang <aceapril@126.com>
  • Loading branch information
Ace-Tang committed Dec 4, 2017
1 parent fe4e30c commit aca8e15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ 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
}
defer task.Delete(ctx)
```

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.
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit aca8e15

Please sign in to comment.