From a71bb87ec714276264282197c99bbd3f86fd7b55 Mon Sep 17 00:00:00 2001 From: Marc Sluiter Date: Tue, 30 May 2017 11:36:19 +0200 Subject: [PATCH] Added namespace and better pod name in client go example --- .../client-go/examples/in-cluster-client-configuration/main.go | 2 +- .../examples/out-of-cluster-client-configuration/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/client-go/examples/in-cluster-client-configuration/main.go b/staging/src/k8s.io/client-go/examples/in-cluster-client-configuration/main.go index ee996a747b..f715068175 100644 --- a/staging/src/k8s.io/client-go/examples/in-cluster-client-configuration/main.go +++ b/staging/src/k8s.io/client-go/examples/in-cluster-client-configuration/main.go @@ -48,7 +48,7 @@ func main() { // Examples for error handling: // - Use helper functions like e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message - _, err = clientset.CoreV1().Pods("").Get("ExamplePodName", metav1.GetOptions{}) + _, err = clientset.CoreV1().Pods("default").Get("example-xxxxx", metav1.GetOptions{}) if errors.IsNotFound(err) { fmt.Printf("Pod not found\n") } else if statusError, isStatus := err.(*errors.StatusError); isStatus { diff --git a/staging/src/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go b/staging/src/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go index 5d0f619ec1..252307b182 100644 --- a/staging/src/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go +++ b/staging/src/k8s.io/client-go/examples/out-of-cluster-client-configuration/main.go @@ -62,7 +62,7 @@ func main() { // Examples for error handling: // - Use helper functions like e.g. errors.IsNotFound() // - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message - _, err = clientset.CoreV1().Pods("").Get("ExamplePodName", metav1.GetOptions{}) + _, err = clientset.CoreV1().Pods("default").Get("example-xxxxx", metav1.GetOptions{}) if errors.IsNotFound(err) { fmt.Printf("Pod not found\n") } else if statusError, isStatus := err.(*errors.StatusError); isStatus {