From bdafcf5aa4d16f1ac745628a355afaeee512fec7 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Tue, 8 Sep 2020 20:59:00 -0400 Subject: [PATCH] [en]: 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/en/docs/tasks/administer-cluster/access-cluster-api.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/en/docs/tasks/administer-cluster/access-cluster-api.md b/content/en/docs/tasks/administer-cluster/access-cluster-api.md index a99b6fe984..d09a29c671 100644 --- a/content/en/docs/tasks/administer-cluster/access-cluster-api.md +++ b/content/en/docs/tasks/administer-cluster/access-cluster-api.md @@ -174,6 +174,7 @@ as the kubectl CLI does to locate and authenticate to the API server. See this [ package main import ( + "context" "fmt" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -187,7 +188,7 @@ func main() { // creates the clientset clientset, _ := kubernetes.NewForConfig(config) // access the API to list pods - 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)) } ```