generated: run refactor

Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
This commit is contained in:
Mike Danese
2020-02-07 18:16:47 -08:00
committed by Kubernetes Publisher
parent 5be5d5753f
commit 60a0346672
95 changed files with 290 additions and 199 deletions

View File

@@ -18,6 +18,7 @@ limitations under the License.
package main
import (
"context"
"flag"
"fmt"
"os"
@@ -60,7 +61,7 @@ func main() {
panic(err.Error())
}
for {
pods, err := clientset.CoreV1().Pods("").List(metav1.ListOptions{})
pods, err := clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err.Error())
}
@@ -71,7 +72,7 @@ func main() {
// - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message
namespace := "default"
pod := "example-xxxxx"
_, err = clientset.CoreV1().Pods(namespace).Get(pod, metav1.GetOptions{})
_, err = clientset.CoreV1().Pods(namespace).Get(context.TODO(), pod, metav1.GetOptions{})
if errors.IsNotFound(err) {
fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace)
} else if statusError, isStatus := err.(*errors.StatusError); isStatus {