From eac11ac629d904e992a40fb496d5ee84f1f88b9a Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Tue, 8 Sep 2020 20:59:36 -0400 Subject: [PATCH] [ko]: add missing context module for the go example The client-go example is missing the param context. This patch adds the missing param. Signed-off-by: Douglas Schilling Landgraf --- content/ko/docs/tasks/administer-cluster/access-cluster-api.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/ko/docs/tasks/administer-cluster/access-cluster-api.md b/content/ko/docs/tasks/administer-cluster/access-cluster-api.md index 8ee76377de..10b97ce630 100644 --- a/content/ko/docs/tasks/administer-cluster/access-cluster-api.md +++ b/content/ko/docs/tasks/administer-cluster/access-cluster-api.md @@ -177,6 +177,7 @@ Go 클라이언트는 kubectl CLI가 API 서버를 찾아 인증하기 위해 package main import ( + "context" "fmt" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -190,7 +191,7 @@ func main() { // clientset을 생성한다 clientset, _ := kubernetes.NewForConfig(config) // 파드를 나열하기 위해 API에 접근한다 - pods, _ := clientset.CoreV1().Pods("").List(v1.ListOptions{}) + pods, _ := clientset.CoreV1().Pods("").List(context.TODO(), v1.ListOptions{}) fmt.Printf("There are %d pods in the cluster\n", len(pods.Items)) } ```