diff --git a/README.md b/README.md index c833f86..437dc5b 100644 --- a/README.md +++ b/README.md @@ -262,7 +262,7 @@ func createConfigMap(client *k8s.Client, name string, values map[string]string) Data: values, } - _, err := client.CoreV1().CreateConfigMap(context.TODO(), cm) + err := client.Create(context.TODO(), cm) // If an HTTP error was returned by the API server, it will be of type // *k8s.APIError. This can be used to inspect the status code. diff --git a/examples/api-errors.go b/examples/api-errors.go index d58244b..4ce3ac8 100644 --- a/examples/api-errors.go +++ b/examples/api-errors.go @@ -25,9 +25,6 @@ func createConfigMap(client *k8s.Client, name string, values map[string]string) } err := client.Create(context.Background(), cm) - if err == nil { - return err - } // If an HTTP error was returned by the API server, it will be of type // *k8s.APIError. This can be used to inspect the status code.