From aca8e159167e1cd0d167de292d1c2fdb285357f0 Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Tue, 5 Dec 2017 00:07:08 +0800 Subject: [PATCH] docs: fix usage of cio package in docs Signed-off-by: Ace-Tang --- README.md | 4 ++-- docs/getting-started.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 361679f85..8d3205e91 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/getting-started.md b/docs/getting-started.md index eab15269b..1e1c1bd0b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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 }