From f61f60e01e64564c6eb12d7e9a743a60dea8d1fe Mon Sep 17 00:00:00 2001 From: Lucas Molas Date: Thu, 21 Dec 2017 13:10:20 -0300 Subject: [PATCH] Update getting-started guide with the new stdio implementation Signed-off-by: Lucas Molas --- docs/getting-started.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index f5f90b49f..c59adbe9c 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, cio.Stdio) + task, err := container.NewTask(ctx, cio.NewCreator(cio.WithStdio)) if err != nil { return err } @@ -239,7 +239,9 @@ 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 `cio.Stdio` `Opt` so that all IO from the container is sent to our `main.go` process. +We use `cio.WithStdio` so that all IO from the container is sent to our `main.go` process. +This is a `cio.Opt` that configures the `Streams` used by `NewCreator` to return a `cio.IO` +for the new task. 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. @@ -360,7 +362,7 @@ func redisExample() error { defer container.Delete(ctx, containerd.WithSnapshotCleanup) // create a task from the container - task, err := container.NewTask(ctx, cio.Stdio) + task, err := container.NewTask(ctx, cio.NewCreator(cio.WithStdio)) if err != nil { return err }